I want to write a simple vb script to automate shutdown in windows.
the code I am using is :
Dim ti
ti=InputBox("enter time in minutes")
ti=ti*60
Set objShell=CreateObject("WScript.Shell")
objShell.Run "cmd shutdown /s /t "& ti & " "
but when I enter the time and press enter , all I get is an command prompt window and nothing happens
I even tried by setting a default value for time and specifing the complete path for shutdown.exe ,but nothing seems to be working
Set WshShell = WScript.CreateObject("WScript.Shell")
Command = "C:\Windows\System32 shutdown.exe -s -t 600 "
WshShell.Run Command
can u please correct me and guide me towards the right code ....
cmddoesn't take parameters like that. Seecmd /?for usage.