dir=”E:/Temp” Set fso=CreateObject(”Scripting.FileSystemObject”) cmd=”shutdown -s -f -t 60″ Set ws=WScript.CreateObject(”WScript.Shell”) Wscript.Echo “emule自动关机脚本已运行……” count=0 do until count<-1 chksize = fso.GetFolder(dir).Size If chksize=0 Then ws.run cmd,0 End If WScript.Sleep 120000 loop因为好多人都不设置存放文件的路径所以,给个比较直接的
Dir = "C:/Program Files/eMule/Temp" Set fso = CreateObject("Scripting.FileSystemObject") cmd = "shutdown -s -f -t 60" Set ws = WScript.CreateObject("WScript.Shell") Wscript.Echo "emule自动关机脚本已运行……" Count = 0 Do Until Count< -1 chksize = fso.GetFolder(Dir).Size If chksize = 0 Then ws.run cmd, 0 End If WScript.Sleep 120000 Loop本人修改的:
Set fso = CreateObject("Scripting.FileSystemObject") Set ws = WScript.CreateObject("WScript.Shell") Count = 0 Do Until Count< -1 chksize = fso.GetFolder("C:/Program Files/eMule/Temp").Size If chksize = 0 Then WScript.Sleep 120000 ws.run "tsshutdn 60 /delay:0 /powerdown", 0 '这个是在一个批处理关机程序里看到的,非常强,试了很多次,各种情况下都能关机(2003系统,其它系统未测) End If WScript.Sleep 120000 Loop