VBS菜鸟首编程序求指点
代码如下
-------------分割线------------------
WSHshellA.run "cmd.exe /c shutdown -r -t 120 -c ""xxx"" ",0,true
dim a
while(a<>"xxx")
a = inputbox ("xxx""xxx"" ","xxx","xxx",8000,7000)
msgbox chr(13) +chr(13) +chr(13) +a,0,"Msgbox"
While Wend If(a<>"xxx") Then MsgBox "xxx",,"xxx"
WSHshellA.run "cmd.exe /c shutdown -a"
Else
MsgBox "xxx",,""xxx"
WSHshellA.run "cmd.exe /c shutdown -r -t 5 -c"
------------------分割线--------------------
错误是第6行第7个字符有语法错误(800A03EA)
xxx不用管,是我要填入的内容
在vbs中你那句While Wend If(a<>"xxx") Then Msgbox "xxx",,"xxx"应该这样写:
While If(a<>"xxx") Then
msgbox"xxx"
这样改了后应该没问题了,(亲测过)
还有,在vbs中if语句尽量不要写在一行,改一下习惯也许对你很有帮助
热门标签: