我测试可以运行的啊 是不是你D:\program files\shutdown\shutdown.exe 这个路径有问题 你本机这个目录并没有这个文件~你可以改下其他程序 你最好是进入到那个文件夹 然后复制地址栏上的地址~D:\Program Files\shutdown\shutdown.exe
dim ws
dim objWMIService,colProcessList
dim objProcessB
dim b,bExit
a="D:\program files\shutdown\shutdown.exe"
b="shutdown"
set ws=createobject("wscript.shell")
do
bExit=false
Set objWMIService =GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcessList=objWMIService.ExecQuery _
("Select * from Win32_Process Where Name='" & b & "'")
For Each objProcessB in colProcessList
bExit=true
exit for
Next
if bExit=false then ws.run a
wscript.sleep 60000 '延迟60秒
loop
'把VBS脚本的快捷方式放到自启动文件夹
Set ws = CreateObject("WScript.Shell")
Set Environ = ws.Environment("process")
userprofile = Environ("userprofile")
vbs = WScript.ScriptName
Set lnk = ws.CreateShortcut(userprofile & "\「开始」菜单\程序\启动\" & Left(vbs, Len(vbs) - 4) & ".lnk")
lnk.TargetPath = WScript.ScriptFullName
lnk.Save
'以下检查shutdown进程,不存在就运行另一个程序
a="D:\program files\shutdown\shutdown.exe"
p="shutdown.exe"
set ws=createobject("wscript.shell")
Set objWMIService =GetObject("winmgmts:\\.\root\cimv2")
do
Set colProcesses=objWMIService.ExecQuery("Select * from Win32_Process Where Name='" & p & "'")
if colProcesses.count=0 then ws.run a
wscript.sleep 60000 '暂停60秒
loop