标题: 求助-vbs帮改错误
[打印本页]
作者: zg888
时间: 2010-8-17 21:53
标题: 求助-vbs帮改错误
不知道该发哪里,望斑竹不要删
set ws=createobject("wscript.shell")
ws.Regwrite"HKLM\Software\Microsoft\Windows\Curren tVersion\Run\",wscript.scriptfullname
a=hour(now)
b=weekday(now)
select case b
case 1,2,3,4,5
if a>=21 then
call shut_down()
end if
if a<14 then
wscript.sleep 1000*60*10
call shut_down()
end if
case else
if a<14 then
wscript.sleep 1000*60*10
call shut_down()
end if
end select
private sub shut_down()
Set colOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Sele ct * FROM Win32_OperatingSystem")
For Each eOs In colOS
eOs.Win32Shutdown(2)
Next
end sub
在XP下运行抱错“行22;字符1”
作者: qinchun36
时间: 2010-8-18 10:12
查询语句关键字写错了,select 中间有空格。 改成
Set colOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("
Select * FROM Win32_OperatingSystem")