I have to separate VBS scripts one that executes a showdown command and one that schedules that shutdown script.
Is there away to combine the two scripts to execute a specific time or how do I make the scheduling script compile.
The schedule script is:
schtasks /create /tn "Shutdown Script" /tr C:\Users\102117\Desktop\shutdown script\shutdown cancel script.vbs /sc daily /st 18:21 /ed 2100/01/01
The shutdown script:
Set WshShell = wscript.CreateObject("wscript.Shell")
WshShell.Run "cmd"
WScript.Sleep 100
WshShell.AppActivate "C:\Windows\system32\cmd.exe"
WScript.Sleep 100
wshshell.sendkeys "shutdown -a"
wshshell.sendkeys "{ENTER}"
WScript.Sleep 200
wshshell.sendkeys "exit"
wshshell.sendkeys "{ENTER}"
WScript.Quit(1)