n3tw0rkadm1n1strat0r
IS-IT--Management
I can't figure out why this isn't working...I'm bad with the quotes...It gives me an error saying that the system cannot find the specified file, but I know that it is there.
Code:
Set objShell = CreateObject("Wscript.Shell")
strComputer = InputBox("Enter the PC name to shutdown:")
strMessage = InputBox("Enter the message to display:")
strTime = InputBox("Enter the time in seconds to shutdown:")
objShell.Run("""%comspec% /K C: | cd WINDOWS\system32 | shutdown.exe -r -m \\""strComputer"" -t ""strTime"" -c ""strMessage"" """), 0, True
Set objShell = Nothing