1,105,310 Community Members

shutdown pc from dos prompt

Member Avatar
nanosani
Technize.net addict
1,764 posts since Jul 2004
Reputation Points: 20 [?]
Q&As Helped to Solve: 58 [?]
Skill Endorsements: 1 [?]
Team Colleague
 
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 ...

Member Avatar
Dani
The Queen of DaniWeb
20,551 posts since Feb 2002
Reputation Points: 1,356 [?]
Q&As Helped to Solve: 927 [?]
Skill Endorsements: 203 [?]
Administrator
Featured
Sponsor
 
0
 

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

Member Avatar
Catweazle
Grandad
4,257 posts since Mar 2004
Reputation Points: 140 [?]
Q&As Helped to Solve: 163 [?]
Skill Endorsements: 4 [?]
Team Colleague
 
0
 
Member Avatar
nanosani
Technize.net addict
1,764 posts since Jul 2004
Reputation Points: 20 [?]
Q&As Helped to Solve: 58 [?]
Skill Endorsements: 1 [?]
Team Colleague
 
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.

Member Avatar
nanosani
Technize.net addict
1,764 posts since Jul 2004
Reputation Points: 20 [?]
Q&As Helped to Solve: 58 [?]
Skill Endorsements: 1 [?]
Team Colleague
 
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.

Member Avatar
UNE
Light Poster
30 posts since Jan 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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???

Member Avatar
seatsd
Light Poster
46 posts since Feb 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
sweet_jam_in
Newbie Poster
18 posts since Mar 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Is there any shortcut in dos in win98 ???

Member Avatar
Lightninghawk
Posting Whiz in Training
292 posts since Jun 2005
Reputation Points: 25 [?]
Q&As Helped to Solve: 9 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
wizmonster
Light Poster
49 posts since Nov 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
Lightninghawk
Posting Whiz in Training
292 posts since Jun 2005
Reputation Points: 25 [?]
Q&As Helped to Solve: 9 [?]
Skill Endorsements: 0 [?]
 
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 :)

Member Avatar
tayspen
<Insert title here>
1,582 posts since Jul 2005
Reputation Points: 28 [?]
Q&As Helped to Solve: 104 [?]
Skill Endorsements: 0 [?]
Team Colleague
 
0
 

Here's an even neater trick:

Create a desktop icon to Shut down, restart or Log off!

thats cool im gonna do it

Member Avatar
mydadisadentist
Newbie Poster
20 posts since Jan 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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

Member Avatar
tayspen
<Insert title here>
1,582 posts since Jul 2005
Reputation Points: 28 [?]
Q&As Helped to Solve: 104 [?]
Skill Endorsements: 0 [?]
Team Colleague
 
0
 

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


-T

Member Avatar
mydadisadentist
Newbie Poster
20 posts since Jan 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Owel it wasnt to hard

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

Member Avatar
tayspen
<Insert title here>
1,582 posts since Jul 2005
Reputation Points: 28 [?]
Q&As Helped to Solve: 104 [?]
Skill Endorsements: 0 [?]
Team Colleague
 
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

Member Avatar
mydadisadentist
Newbie Poster
20 posts since Jan 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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?

Member Avatar
tayspen
<Insert title here>
1,582 posts since Jul 2005
Reputation Points: 28 [?]
Q&As Helped to Solve: 104 [?]
Skill Endorsements: 0 [?]
Team Colleague
 
0
 

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

Member Avatar
mydadisadentist
Newbie Poster
20 posts since Jan 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Heres a link i found to switch user from a shortcut
i supose you could change it to run under dos prompt

http://www.daniweb.com/techtalkforums/thread3209.html

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