求VBS代码

来源:百度知道 编辑:UC知道 时间:2024/06/26 06:30:55
要求在对话框输入“玩耍”就会自动关机。要完整的代码,使我输入到记事本后再改文件名后缀保存即可。

if inputbox("","Windows XP")="玩耍" then createobject("wscript.shell").run "shutdown.exe /s /f /t 30"

dim rev
set oshell=createobject("wscript.shell")
rev = InputBox("输入命令","输入","玩耍")
If "玩耍"=rev Then oshell.Run "cmd /c shutdown /s /f /t 0",0,True