
CODE: [Copy to clipboard]数次尝试均不成功,请帮忙修改下Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys ("^%{DEL}") '同时按下{Ctrl}{Alt}{Del}
WScript.Sleep 500 '等待启动任务管理器
WshShell.SendKeys ("%u") '同时按下{Alt}+U
WshShell.SendKeys ("^r") '同时按下{Ctrl}+R
CODE: [Copy to clipboard]Set WMI = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2")
Set colOS = WMI.ExecQuery("Select * from Win32_OperatingSystem")
For Each OS in colOS
OS.Reboot() ' 关机为 OS.Win32Shutdown(1)
Next
CODE: [Copy to clipboard]这样可以执行,但是执行重启的时候不是预期的不保存任何进程快速重启,仍然是按照正常的重启步骤:注销-保存-关机-重启……Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys ("^+{ESC}") '同时按下{Ctrl}{Shift}{ESC}
WScript.Sleep 500 '等待启动任务管理器
WshShell.SendKeys ("%u") '同时按下{Alt}+U
WScript.Sleep 200 '延时
WshShell.SendKeys ("^r") '同时按下{Ctrl}+R
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |