1 dynamic shellObject = Interaction.CreateObject("WScript.Shell", ""); 2 //打開IE設置-安全 3 shellObject.Run("Rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,1"); 4 await Task.Delay(500); 5 //默認級別 6 shellObject.SendKeys("{TAB}"); 7 shellObject.SendKeys("{TAB}"); 8 shellObject.SendKeys("{TAB}"); 9 shellObject.SendKeys("{TAB}"); 10 shellObject.SendKeys("{R}"); 11 12 await Task.Delay(100); 13 shellObject.SendKeys("{TAB}"); 14 shellObject.SendKeys("{TAB}"); 15 shellObject.SendKeys("{TAB}"); 16 shellObject.SendKeys("{A}"); 17 18 await Task.Delay(100); 19 shellObject.SendKeys("{ENTER}");
如上步驟以下,html
如上步驟中,等待的時間並不是必定的,是我的根據調試結果,設置的一個貌似OK的值。git
Rundll32 Commands 列表參考:List of Rundll32 Commands in Windows 10github
Github地址:IE環境修復工具shell