We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,307 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

shutdown pc from dos prompt

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 ...

10
Contributors
18
Replies
1 Year
Discussion Span
7 Years Ago
Last Updated
19
Views
nanosani
Technize.net addict
Team Colleague
1,832 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
Skill Endorsements: 0

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

Dani
The Queen of DaniWeb
Administrator
21,551 posts since Feb 2002
Reputation Points: 1,555
Solved Threads: 376
Skill Endorsements: 124
Catweazle
Grandad
Team Colleague
4,335 posts since Mar 2004
Reputation Points: 229
Solved Threads: 149
Skill Endorsements: 3

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.

nanosani
Technize.net addict
Team Colleague
1,832 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
Skill Endorsements: 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.

nanosani
Technize.net addict
Team Colleague
1,832 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
Skill Endorsements: 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???

UNE
Light Poster
30 posts since Jan 2004
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

seatsd
Light Poster
46 posts since Feb 2005
Reputation Points: 11
Solved Threads: 0
Skill Endorsements: 0

Is there any shortcut in dos in win98 ???

sweet_jam_in
Newbie Poster
18 posts since Mar 2005
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

Lightninghawk
Posting Whiz in Training
296 posts since Jun 2005
Reputation Points: 35
Solved Threads: 9
Skill Endorsements: 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.

wizmonster
Junior Poster in Training
50 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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 :)

Lightninghawk
Posting Whiz in Training
296 posts since Jun 2005
Reputation Points: 35
Solved Threads: 9
Skill Endorsements: 0

Here's an even neater trick:

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

thats cool im gonna do it

tayspen
<Insert title here>
Team Colleague
1,622 posts since Jul 2005
Reputation Points: 84
Solved Threads: 100
Skill Endorsements: 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

mydadisadentist
Newbie Poster
20 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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


-T

tayspen
<Insert title here>
Team Colleague
1,622 posts since Jul 2005
Reputation Points: 84
Solved Threads: 100
Skill Endorsements: 0

Owel it wasnt to hard

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

mydadisadentist
Newbie Poster
20 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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

tayspen
<Insert title here>
Team Colleague
1,622 posts since Jul 2005
Reputation Points: 84
Solved Threads: 100
Skill Endorsements: 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?

mydadisadentist
Newbie Poster
20 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

tayspen
<Insert title here>
Team Colleague
1,622 posts since Jul 2005
Reputation Points: 84
Solved Threads: 100
Skill Endorsements: 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

mydadisadentist
Newbie Poster
20 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.1228 seconds using 2.75MB