does anybody know how to shutdown or restart the pc with code.
thanks.
Printable View
does anybody know how to shutdown or restart the pc with code.
thanks.
A non api way.
the -t means the time before the shutdown or restart so you can change the 00 to say 20 which will show a message box warning you that it will shutdown in 20 seconds or whatever amount you set.VB Code:
Shell "shutdown -s -t 00" 'shutdown Shell "shutdown -r -t 00" 'restart Shell "-a" 'abort
casey.
tsshutdn /?
will shut down remote machines, too.
Only Authenticated USERs.. :wave:
its not working
says filenot found
notquitehere188, what are you refering to ?
casey.
VB Code:
Shell "shutdown -s -t 00" 'shutdown Shell "shutdown -r -t 00" 'restart Shell "-a" 'abort
you have to locate the file. if it's here, call it like this:
VB Code:
shell "c:\windows\system32\tsshutdn.exe "