okay...well im trying to create a script that when executed it brings up a window that asks if you want to shutodwn the computer, i already have the message box..but i am not sure how to exec shutdown.exe or w/e...so someone help me pleaessee
x = MsgBox("System will be shut down immediately", ,"Immediate Shutdown") shutdown -s -t 00
So..is that the code..? kuz when i run it it says there is an error on the last two charecters and it wont exec.
Edit: or would you put that in launch options if you can do that..im confused.
can't do a cmd line directly in vb like that, it doesn't know what to do with it. You would be to have a batch file and have the cmd line:
Code:
shutdown -s -t 00
then in your vbscript file, something along the lines of:
Code:
Dim x
Dim WSHShell
x = MsgBox("System will be shut down immediately", ,"Immediate Shutdown")
if (x = vbYes) then
Set WSHShell = CreateObject("Wscript.Shell")
WSHShell.Run ("c:\yourBatfile.bat")
end if
in the line WSHShell.Run, you may be able to put "shutdown -s -t 00" into the quotes and run it without the batch file.