how to write simple scripts

muzikool

Act your wage.
Political Access
Joined
27 Dec 2001
Messages
7,626
I've never written a script before and I need to make a few simple ones: one to logoff, one to shutdown, and one to reboot. I know that the command line arguments are -l, -s, and -r. I just don't know how to put those in a script.
 
shutdown -s -t 0

that will shutdown the system in 0 seconds.

shutdown -r -t 0

that will restart the system in 0 seconds

shutdown -l -t 0

yeah.
 
rundll32.exe user32.dll,LockWorkStation

^lock the workstation
 
(from command prompt)

shutdown /?

Will give you a list of all possible switches and their descriptions.
 
how do i put the commands into a .vbs script? i am trying to follow muzikool's example for putting together a samurize config. i've linked my buttons to a script with the shutdown command, but i get an error, "expected end of statement". what needs to be added, a simple "end"? thanks
 
its what i got from muzikools config -
shutdown -s -t 0
 
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run("shutdown -s -t 0")
 

Members online

No members online now.

Forum statistics

Threads
62,021
Messages
673,242
Members
5,639
Latest member
Everlong
Back
Top