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.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie Electronic Punk Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. 🙁

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk Sazar Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,016
Messages
673,499
Members
5,630
Latest member
REALMTBENJOYER
Back