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

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?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!
Perris Calderon wrote on Electronic Punk's profile.
EP, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there!

Forum statistics

Threads
61,997
Messages
673,401
Members
5,586
Latest member
PseudoKiller