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.
 

cpugeniusmv

Computer Genius
Joined
14 Apr 2003
Messages
485
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.
 

j79zlr

Glaanies script monkey
Political Access
Joined
16 Feb 2003
Messages
2,725
rundll32.exe user32.dll,LockWorkStation

^lock the workstation
 

chaos945

OSNN Senior Addict
Joined
10 Feb 2003
Messages
934
(from command prompt)

shutdown /?

Will give you a list of all possible switches and their descriptions.
 

khs

OSNN Junior Addict
Joined
23 May 2004
Messages
10
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
 

khs

OSNN Junior Addict
Joined
23 May 2004
Messages
10
its what i got from muzikools config -
shutdown -s -t 0
 

cpugeniusmv

Computer Genius
Joined
14 Apr 2003
Messages
485
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")

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

Members online

No members online now.

Latest profile posts

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 wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?

Forum statistics

Threads
62,005
Messages
673,461
Members
5,599
Latest member
Larry Chris