自动关机脚本:将以下代码保存为VBS文件
Set myobject=wscript.createobject("wscript.network")
Set myshell=wscript.createobject("wscript.shell")
Name=trim(myobject.username)
Dim curhour
Dim abc
if name="用户名" then
Curhour=hour(time)
Aa=curhour
Do
Cuhour-hour(time)
Loop until curhour>=abc+2
if curhour<=22 then
Myshell.run "shutdown -s -t 300 -c ×××,你已经连续玩了两个小时,得休息一会! -f"
Else
Myshell.run "shutdown -s -t 300 -c ×××,现在已经22点,赶紧关机睡觉! -f"
End if
End if
Set myobject=wscript.createobject("wscript.network")
Set myshell=wscript.createobject("wscript.shell")
Name=trim(myobject.username)
Dim curhour
Dim abc
if name="用户名" then
Curhour=hour(time)
Aa=curhour
Do
Cuhour-hour(time)
Loop until curhour>=abc+2
if curhour<=22 then
Myshell.run "shutdown -s -t 300 -c ×××,你已经连续玩了两个小时,得休息一会! -f"
Else
Myshell.run "shutdown -s -t 300 -c ×××,现在已经22点,赶紧关机睡觉! -f"
End if
End if
回复Comments
作者:
{commentrecontent}