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

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

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.

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.

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

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.

Is there any shortcut in dos in win98 ???

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:


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.

delete /?

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

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.

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 :)

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

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


Owel it wasnt to hard

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

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?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.