1.11M Members

shutdown pc from dos prompt

 
0
 

you can shut down your pc from dos prompt like this :
type .... shutdown -s ( it'll give you 30 secs to save your work and then it'll shutdown)

for restart type shutdown -r
and for logoff type shutdown -l

for more options type shutdown only.

I tested these only on win xp ...

 
0
 

Ahh ... the shutdown -r command ;) I use that command in linux hehe :)

 
0
 

Hey Catweazle I had that in mind too .. but when I tried that .. I clicked on the shortcut ... and bang .... it restarted my pc ... all my work went in vain .. hehe. So I thought I'd better not post that here.

 
0
 

Ahh ... the shutdown -r command ;) I use that command in linux hehe :)

It's been a long time when I used linux but what I remember is that I used to shutdown linux with halt command ... is it still used or shutdown is the new command .... I've used Red Hat Linux 4 I think.

 
0
 

i have tried to use those commands in Win2000 OS but it didnt work it displaied this:
"Cannot find the file “shutdown (or one of its components). Make sure the path and filename are correct and all required libraries are available "

which are those libraries any idea???

 
0
 

To shutdown 2000 from the command lline I think you can use:
rundll.exe user.exe,exitwindows

Well, I know it worked back in Windows 95 anyways.

 
0
 

Is there any shortcut in dos in win98 ???

 
0
 

DOS shutdown commands with fun attachments.

Ok as you know by now when you reach a DOS Prompt you type:

shutdown -s [to shutdown]
shutdown -r [to restart]

Now how about adding a little flavor to them. Especially Windows XP users:

the switches:

-c [allows you to type a comment inside quotation marks that will be shown on screen during the shut down process] ex:

-c "your text here"

-t [this switch allows you to se a time in seconds til the shutdown occurs]ex:

-t 15
-t 84

the first one sets the timer at 15 seconds
the second one sets the timer at 84 seconds
so if you type the following into the command line:

shutdown -r -c "Your computer is now restarting" -t 12


this command creates the following situation:

Restarts the computer:
While displaying a neat dialogue box, with a countdown showing, and showing the message ::: your computer is now restarting :::


There are many other switches as well. Say you don't want to shutdown or restart, you just want to logoff.
type this switch:

logoff.exe

and you logoff.
I'm am still searching for the switch for Switch User though :(

Hope you like this information. It also works inside of batch files as well.
:)

PS: Most all DOS commands work in EVERY DOS invironment. There are very few changes. But yes these commands for the most part also work in 98SE.

On another point. There are many that were not built into the 95 or earlier editions of windows though.

For a fairly complete list of common DOS switches in XP:

Open your CMD/DOS/Command Prompt and type the switch

/?

This is also helpful for finding alternate uses for specific switches: like say you need help with the delete command switch.
type:

delete /?

this will list all of the optional switch addons available for the delete command.

 
0
 

Lightninghawk, that's WAY cool! I'm gonna try that and the one that Catweasle mentioned, too. Maybe the best of both ideas would be a Desktop shortcut to a DOS batch program run full screen....hmmmmm.

 
0
 

Actually.. I have a folder on my desktop that has files that I use to shutdown, restart, and logoff.. I am still looking for the switch in DOS for the Switch User command...

still looking....
google is my friend but it's not being cooperative......

if anybody else finds that command please post here :)

 
0
 

I saw this thread today and i thought id make a console program in c++ using :
system("shutdown -s")

It works quite well and is alot easier cus of the .exe file

also ive been looking for a way to switch user but no luck so far.
whats the point though when you can just use windows logo + L

 
0
 

Hm, good idea, but wouldnt it have been easier to make a bath file (.bat)? Or just make a shortcut...


-T

 
0
 

Owel it wasnt to hard

and neway i dont no how to make a "Bath file" or what it does???

 
0
 

Hi a batch file is a file used to execute commands. To use a batch file open up a text documents and put

shutdown -s

Then save it as shutdown.bat, when you want to shutdown double click it. More can be read here.

http://www.experts-exchange.com/Miscellaneous/Q_21257745.html

-T

 
0
 

ow k cheers i get it now

neway now my program includes a varible for how long til shutdown\restart and all the options in 1 .exe could you do that in a batch file?

 
0
 

Yes, that link i sent you shows it, just add that to the batch file, this could also be done via command prompt.

Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: