This is one of my favorite tricks, shutting down my Windows XP machine with one simple line of code!
This might not seem necessary since the power button is tucked neatly inside the Start Menu, but this trick has a few more uses. Not only can you use this on your machine, but on network machines as well – as long as you have administrative access! You can also restart machines, set comments (the reason for the shutdown), specify time and more!
List Of Shutdown Command Switches
| No Switches | Display information about the shutdown command, same as typing “-?” |
| -i | Display a GUI. It must be the first switch |
| -l | Log off the user (This cannot be used on a remote machine: “-m” switch) |
| -s | Shutdown the computer |
| -r | Restart the computer |
| -a | Cancels a system shutdown already in progress |
| -f | Forces running applications to close without warning |
| -m \\computername | Instruct a remote computer to shutdown (can be used with the restart & abort switches) |
| -t xx | Set a given time for shutdown, in seconds |
| -c “comment” | Shutdown comment (maximum of 127 characters) |
| -d [u] [p]:xx:yy | The reason code for the shutdown: u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) |
How To Use Shutdown Switches:
You don’t have to use them all, but the switches you do use must be in the following order:
shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]
How To:
Open the command prompt: Windows Key + R then type the command below and hit OK:
cmd
This will open the command prompt. Now we can play!
Note: You could type the shutdown command directly into the Run dialog. I don’t advise this. If there is a typo or error, you won’t know. There is no information given!
Shutdown Local Machine
This only takes a couple of keystrokes. Type the code below and hit OK:
shutdown -s
“shutdown” tells the computer what command we want to execute and the “-s” switch tells it what to do, which is to shutdown!
Specify Time
shutdown -s -t 60
Now we have added the “-t” switch and a variable, which in this case is “60″. This number is the number of seconds before the computer is shutdown. A dialog will open and display a count down timer!
Give Us Some Info!
shutdown -s -t 120 -c "You better finish, because I shut you down foo!"
The “-c” switch will allow you to give the user some information for the reason of the shutdown.
Shutdown A Remote Computer
shutdown -s -m \\desktop -t 45
I really like this one! The “-m” switch will allow you to shutdown a remote machine, in this case, a computer named “desktop”. For this to work, you must have administrative access to the computer! To see of you do, hit Windows Key + R then type the computer’s name, i.e.:
\\desktop
If you can connect to it, you will be asked to log into the machine with a user name and password. Once confirmed, a window will open displaying the directories available to you. Now you know you can shut it down remotely.
Cancel Shutdown
Let’s say that you need to cancel a shutdown in progress. Go to the computer in question, hit Windows Key + R then type command below:
shutdown -a
This will abort the shutdown, assuming there is a counter and it hasn’t reached zero yet!
Ah! Abandon Ship!! That could come in handy.
I use it all of the time – especially if I’m feeling too lazy to walk across the room to shut down a machine!
how do you find a computers name in the same network as you?
To find the name of computers in the same domain , go to network places and click workgroup computers.
I hope it would solve ur problem.
Thankyou.
on the run box, type cmd,then type hostname.
Laugh out loud!
I use this to create a great big SHUTDOWN icon on the computer at my parent’s house – so they would stop pulling the plug out of the wall to shut down the computer.
Oh man, that is hilarious! I remember when we used to unplug our 386 too!
That is just to much! I suppose if it’s right on the screen they may actually use it once in a while…
how?
ooh i’ve read about this before…
but whenever I try to shutdown a remote computer, it doesn’t do anything. It works when I’m shutting down my laptop though.
I typed in //mainframe (that’s the name of the computer) and it didn’t ask for a username/password but instead just opened the directories. How would I set my laptop to become an administrator for that computer?
Also is there anyway to turn a computer on remotely? I use my family’s desktop for storage and my parents always turn it off after they use it and I’m too lazy to turn it on to get files on the network drive
Thanks in advance!
sorry for the double comment but I’m not sure if you’ve seen this…
1) How do i set my laptop as an administrator for the desktop? (check comment above)
2) Is there a way to turn a computer on remotely?
I’m not 100% sure….
Try making sure they’re both on the same workgroup and make accounts on both machines that have passwords…
I know that you can access files on the other machine using:
//mainframe/c$I just realized that I missed you second question, I’m not too familiar with Wake on Lan but it looks like you need some prerequisites:
Getting Wake On Lan (sometimes called Remote Wake Up) to work
i use this and speard it arround the internet so people think they got big virus
email me at [email removed] because i need some hints on how to shut down computers on a lan server (such as at School)
So how do you run a shutdown from a file? Can’t figure out how
Check this post out: Windows Tip: Shutdown Your Computer With A Batch File
Let me know if you need more help!
also you could us c++ or visual basic.
Visual basic is probably the easiest
next to batch of course, but batch files look kinda scary:
shell ("shutdown -s -m \\desktop -t 45")hey i had made a batch file with the command shutdown but i want to schedule that batchfile in a timer everyday without my approval it should shutdown or restart from a particular time say from 1:00pm to 4:00pm it should only restart the computer………………….
Do anyone know that how to scheduled the timer……………….
Chris, I wrote about scheduling a shutdown with a batch file. Let me know if you need any help!
can someone tell me how to fix this problem
if the answer is administrative access can you tell me hoe to do that
Thank you very much,
Drakord
drakord your problem is u dont have a administrator command prompt u have to make one the old fashioned way. vista dosnt give u direct access to stuff like that on vista.. hope that helped a lil
is there any way of making a logoff version into a desktop shortcut?
There sure is! Check out: Windows Tip: Log Off Your Computer With A Shortcut
I need HELP!!!!!!!!!! I used the shutdown command followed by my roomates IP address. Apparently two computers shutdown and they are having a hard time connecting to the internet.
That odd – for one, they shouldn’t have the same IP address. Two, the shutdown command only shutsdown the computer – just as if you clicked Start->Shutdown.
Check for viruses or maleware….
can i ask something????
how to configure a network using a command prompt or run???
plz give me some tips for this problem…
I think this is what you’re looking for: Set Your IP Address Via Batch File
This will come in handy.
hey, i got some questions, when you shut down a computer remotely, like shutdown -s -m \\desktop, how do u get the computers name, and how do u get administrator access if u dont have it? Oh and yea it is realy funny to mess with people with this stuff, like when u send em a message on there comp (net send * ” “) that sais something like “Massive system failure”. man they freak out…..
To find the computer’s name, walk to that machine and hit the Windows Key+Pause/Break, then click the “Computer Name” tab! Look for: “Full computer name”
As for administrative access – that’s kind of the point, you need to be given access, you can’t just take it…
Hi…. Neeed Help…….. how to access other computer drive from command prompt (Not from My network Places)…… Please do reply……
Regards,
Is this a local drive? Just type the driver letter….
I’m going to be complete honest here. I’m looking for ways to simply mess with the computers at school. Recently, I realized I can open command prompt with a batch file (it was blocked if I tried to run it normally). That being said, I think I might be able to get this remote shutdown thingy to work. However, I encountered problems with Net Send. If anybody could help me out with netsend or with anything that I would consider “fun” (nothing malicious wanted), please let me know.
Is there a command I can use automatically delete “xpicleanup.dat” when windows xp shutsdown?
If any body can come up with one, what is the command and were would I place the command?
yeah it s grt
but if i want to shut down the system after few minutes r after an hour then?????
Then just change the time after the “-t” variable. The following is 60 seconds:
shutdown -s -t 60The next one would be five minutes (60 seconds x 5 minutes):
shutdown -s -t 300just want to ask a few things about this topic:
1 i cant get it to work because my computer wont notice my sisters laptop on the network
2 can i work if im not using a server
3 thanks for this if i can get it to work like i can on my computer this will be the best thing by april 1st
thanks my email is EMAIL ADDRESS REMOVED
Well, there are a few things you can try:
you got some really cool blogs here i am new to this so anything that will help with anytrhing will be cool where do u thing i should start from thanks
is it possible to tell it to shut down in like 30 mins or 1 hour?
cause when i tried shutdown -s -t 2100 (which is like 35 mins i think)
some explanations came up saying the valid range is 0-600, which is up to 10 mins.
is it possible to extend this?
thanks
I’ve never tried such a long variable but if you’re getting an error, I would guess not. You can however, use the Task Scheduler to shut down the computer at a later time.
There is no actual time limit. I dont know how many seconds i just put in but its not scheduled to shutdown for another 11 days. XD
my laptop does not do any of the commands (maybe im typing them wrong. waht im doing is only -r. is that the way to do it?)
can i use this at school even if its not on the administrator account?
The correct usage would be:
shutdown -rYes, you do need to be an administrator.
hei can you help me plz, im on a network with my mom sis and bro, i want to shutdown my bro’s computer tho, how do i do that? ive tried what it says to do to “shut down a remote computer” and it dsnt work, it jz tells me all the switches, ik his login info for his pc if that helps….? i really wana know how to do this cuz sometimes hell shutdown my internet so then i want to shutdown his pc before he can do that
thxxx
I can’t say that I condone the use of this for a prank (or the use of terrible grammar), but here are a few things you need to check:
next time it happens tell your mom
make it sound worse than it is, and he might just get grounded ahaha
And that hurts more than shutting off his pc, which he can easily turn back on.
2Perfect’s last blog post: Demonoid Returns (better than Batman’s)
i beleive we are on the same network, but no i dont hav an account on both machines, jz on mines but ik his login info.; the password or the NETWORK? if so yes; idk bout #4 but ik that like if he wants a song i put it in my shared files and he gets it off his pc so we must be lke connected…? and i wanna piss him off 2perfect
Both computers should be on the same Workgroup, you need to know an administrator’s credentials for the remote machine and the remote machine needs to have the Local Security Policy setting for Network Access: Sharing and security model for local accounts set to Classic.
Try those items.
k thx
also he runs vista, make a diffrence?
Yes it probably does. Vista might have a few extra things you’d have to do with permissions and such. Unconfirmed though.
Also, if you’re running Windows XP Home, I don’t think you can do it (also unconfirmed). You’d have to be running win xp pro. Because I’ve tried this myself and can’t turn off my basement computer at night with a Home pc, but i can do it with an XP pro pc.
Not true! The “shutdown” command IS a part of XP Home SP3. These shortcuts work fine on my Acer, And my Dell.
cool!
JB
yea i got XP
well yea im running XP
Can you shut down a computer at an internet location?
shutdown -r -f -m \\(domain name) or (IP Address)If so, what are the NAT ports I need to have enabled to do this?
Sorry, only machines on your current network.
it keeps saying that a required privalige is nedded and i ont have it
hey guys i know this has already been answered but how (in details
) do you give rights to yourself.
the situation is my brother is being a noob and wont go to bed early hence hes being late for classes since he cant wake up. Sooo i want to shut his computer off but cant do so because i dont have the admin rights . Can someone post in details how exactly do i go onto his computer and specifically give myself the rights.?
Hes using xp and im on vista and i can access his comp in network but no login box comes up??
if someone can help me that would be good, you will be makin my bro go to school on time
?that helped alot but you can use ctrl alt adn del to shut down faster¿
True, but you can use the command in programming a batch or command file.
hi
i tried using the shut down command. but my computer doesnot get shutdown completely. i see my cpu lights glowing.(i think the power is still on ) how can i shut it down completely?
Hello! Is there another way in remote shutdown without administrative access? tnx
Nope, shutting down a computer is an administrator’s function.
Ye, i have a problem. I managed to shut down my pc, but i cant shut the one down statirs down. Windows fireall is off down stairs and so is mine. i typed the code in correctly, but says… Acces is denied
firewall or not, you’ve gotta have permissions set on the remote comp. I just ran into this problem doing a remote backup on my desktop from my laptop with vista, (desktop has xp) I needed to set permissions on the desktops backup folder to allow anything to get in there without username/password. You still need to know the username/password used on the account the folder is in, but no special or extra one needs to be made. I hope i helped some.
-later
blaze it up guyz
one question please !
If I want to shut down my pc at 23:25
every Sunday,Monday,Tuesday,Wednesday,Thursday ,and at 23:55 every friday and saturday , how can I do ?
thanks a lot !
Lupty,
You can accomplish this by scheduling a task – actually, two: one for the weekdays and one for the weekend. You can get more information on my post: Windows Tip: Start Your Day With A Fresh Computer, Step Four: Automate A Reboot
thanks!
I use it all the time to
I have set it up to my telephone, so i just sent an textmessage, and all the computers is shutting down
1. do u need a network privilge
2. i cant do it plz help
and 3 .sorry i took 2 posts how do u set it up to ur phone
Neil, that all depends on your phone and your network configuration…
thanks for responding
but wat does ur phone have to be at
IT DOESNT WORK IT SAYS ACSESS DENIED
THAT SUCKS !!!!
Hello! Is there anyway to shutdown Windows immediately, -s option shutdowns Windows for 30 seconds. Option -t 0 works, but is there any other way?
How do you stop shutdowns,because evrytime i log on a counter shows up and i always have to do shutdown -a! is there a way to stop the countdown 2 show up??
Do you know how to hack so that you get administrative access to other people’s computer in your LAN?
i have one question about this remote shutdown command.
“shutdown -m \\desktop -s -t 0″
After i run this command but it can’t power of the PC and show the message about you may safe to shutdown the PC!
i would like to know how can i logout & power off the PC?
Ray,
The code, as you have posted it, does not allow you to manually power off the machine. This action automatically logs out the user and shuts down the computer.
By adding the -t switch and 0 variable, you are telling the computer to shutdown immediately.
This is awsome i’m using it at school now turning my friends co mputers off is halerious they dont know what happened
hey jamie um i was wondering if you could tell me how you shut down there computers at school?
I have tried running the shutdown command in a batch file with some of the switches, but get an infinite loop for some reason. anyone got an idea?
is their any way i can just shut down the screen without any program by running the command prompt??? (no, the screen does not have a “turn off” button, its a laptop XD)
You could just set your power management to turn off the monitor after a certain amount of time.
hi…
I’ve been reading all this blog because I have a question….I need to turn ON and OFF a computer that is not on the LAN…is an outside computer…I found the way to TURN ON, by a webpage where I send the information of that computer and the port number of the router, but I would like to find the way to TURN OFF the computer the same way…
Maybe somebody can help…
Remember the computer is not on the LAN
XOXO
D:)
Hi, I was just wondering how to actually remotely shutdown because I have tried all the suggested methods above as well as shutdown -i
My problem is that “Access Denied” is printed in command prompt instead of shutting down the other computer.
i want to know how to find out computers names so i can shut them down, or just ip addresses. i cant figure out how to get them
suas disgraças
мм… интересно ..
I cannot get this to work.
shutdown -s -m \\desktop -t 45
I have 2 laptops side by side and each is set to allow full control and on the same workgroup.
I can shut down the one I am on but nothing happens to the other.
I can access and change files but no shutdown.
Awesome! Thanks a lot!!!! Very Useful!
oh this is very good i am getting relax in these time
Wow its great///;;;;;;;;;
Thanks, those commands are just what I needed for my batch file, I’ll give you guys a look at it;
@echo offecho Hello, and welcome
ping localhost -n 3 > nul
cls
echo To my world
ping localhost -n 3 > nul
cls
echo There will be a 25 second count down
ping localhost -n 3 > nul
cls
echo And then...
ping localhost -n 2 > nul
cls
echo BOOM!!!
ping localhost -n 2 > nul
cls
echo 25
ping localhost -n 2 > nul
cls
echo 24
ping localhost -n 2 > nul
cls
echo 23
ping localhost -n 2 > nul
cls
echo 22
ping localhost -n 2 > nul
cls
echo 21
ping localhost -n 2 > nul
cls
echo 20
ping localhost -n 2 > nul
cls
echo 19
ping localhost -n 2 > nul
cls
echo 18
ping localhost -n 2 > nul
cls
echo 17
ping localhost -n 2 > nul
cls
echo 16
ping localhost -n 2 > nul
cls
echo 15
ping localhost -n 2 > nul
cls
echo 14
ping localhost -n 2 > nul
cls
echo 13
ping localhost -n 2 > nul
cls
echo 12
ping localhost -n 2 > nul
cls
echo 11
ping localhost -n 2 > nul
cls
echo 10
ping localhost -n 2 > nul
cls
echo 9.
ping localhost -n 2 > nul
cls
echo 8..
ping localhost -n 2 > nul
cls
echo 7...
ping localhost -n 2 > nul
cls
echo 6....
ping localhost -n 2 > nul
cls
echo 5.....
ping localhost -n 2 > nul
cls
echo 4......
ping localhost -n 2 > nul
cls
echo 3.......
ping localhost -n 2 > nul
cls
echo 2........
ping localhost -n 2 > nul
cls
echo 1.........
ping localhost -n 2 > nul
cls
echo 0..........
ping localhost -n 2 > nul
echo BOOM!!!
shutdown -s
That’s a lot of code. What about trying a loop with a decreasing variable?
how do u make an icon so that when u press it it shuts down? can you reply in the forum.
try it using a batch file..
by simply typing this code to a notepad and save as it as filename.bat
the command is
@echo offshutdown -s
dont worry about it anymore, i know now. this is hell good. my friends got so pissed off.
the best way to shutdown computers with cmd is shutdown -i and just browse and u can see all computers on the domain.
It would be interesting to do a mashup using one or several of the: Orange Instant APIs
couldt i do this with an ip instead of name ?
I done a registry cleaner and deleted everything. I never read what it said and now when i shut down my laptop it goes strait to standby. How can i fix this
oh this is very good i am getting relax in these time
oh this is very good i am getting relax in these time
realllllllyyyyy
HI This is Sandeep pandey from Mirzapur & i am great varior khal of Nanhupur I done a registry cleaner and deleted everything. I never read what it said and now when i shut down my laptop it goes strait to standby. How can i fix this
dont worry about it anymore, i know now. this is hell good. my friends got so pissed off.
hey this is for the one of the school jokes. (2Perfect) in the school they sometimes prohibit you to enter to a website, mostly games pages. I think this can work
in cmd, ms – dos (don’t know how it is called) type this
1)ping website’s name
it will give you the IP
then type:
2)start iexplore.exe and the number it gave you.
or go to internet and type the IP
in my school it worked. I’m not too expert.
is there a post that shows you how to create a network, or is it too easy? if it is can someone explain me?
hey everybody’s talking about a shortcut, how do I do that? if it is only code with the command prompt, can I save it or what? may someone help me?
you have to open the notepad and save the code into a file with .bat extension
*Start - Run
*"write down "notepad" without quotes
*write down "shutdown ....." no quotes
*Click, save
*Save as a file.bat (removing .txt extension)
NOW help me, i want to merge a file into a picture, in someway that whenever the picture is opened, the batch file is opened too
How can i do this?
This came in very handy at work. I had to remotely shutdown a fileserver (several states away) that was located in a room that lost climate control due to a power outage. I attempted to shutdown the box through a terminal session, but after I clicked shutdown, the session terminated, but the server was still online.
shutdown -s -m \\servername -t 30 got the box offline and not a moment too soon, because the environmental alarms were triggered because the temperature reached a critical point.
Thanks for this.
I have a home Windows XP network with 3 computers (computer-1, computer-2, computer-3). I cannot get any of them to remotely shutdown.
For example when I type: shutdown -s -m \\computer-1 -t 45
I get the message: The network path was not found.
I am an Administrator and the rest of the network works. Thank you in advance.
Can you ping the other computers?
I can ping from computer-1 to computer-3, but not the other way round! On computer-3, I get the response: ‘Request timed out’.
let’s just shut all these fucking commands..
why window has launched GUI..?
for our own convinence..
How can I keep the shut down MSG floating or on top of the window but allowing customers to continue using the PCs. I am asking because our PCs are configured to run in a shell mode.
Thank you so much for any input
Ramos
ok so what i found out is that if you write this into a notepad and save it as a .bat
shutdown -s -t 1
then hide the .bat file some where.
then go to control panel then to scheduled tasks and schedule it to run when the computer logs on, that not only does it turn your computer off after one second it will do it on the computers administrator account so one that does not even really have the file on it.
can anyone help me find a way around this to stop it from shutting down even though you only have 1 second before it shuts off?
Try booting the computer into Safe Mode. If that doesn’t work, you can use a Linux Live CD to mount the Windows partition and delete the .bat file.
Wow! fantastic. I did it for the first time, I had tried alot before, but failed.
Realy usefull for me, I appreciate it.
Danish wahidi-Kabul
I acquired an admin account through help of a friend that works in my schools office and i was able to shut down most of the computers in my school.
some one tell me how can i use it its right or wromg command
We have Admin accounts that have access to all machines in the domain. However, we log into our personal machines with our regular accounts rather than our admin accounts.
I have a server I have to reboot and would like to use this.
Is there a way to include my admin user name and password within the command?
how do i command the computer to shut down i an hour (like i want the pc to shut down after 15 minutes)
so i want to play a practical joke on my sister,
so i did “shutdown -i”, and when i click to browse to look for my sisters computer it says “the active directory domain services is currently unavailable”.
how do i get around this, do I have to be an administrator of that computer, if so how do i become an administrator.
hey Saman ,
this is a gr8 post n is very educational for novices like me.
although it helped me a lot but i m stuck in between in making my cmd line script, n would appreciate if u help.
1st 2 explain the purpose of making script- i have a free unlimited downloading for a limited period of time broadband connection but its free usage time is 2 awkward – 2am 2 8am which is the time for dreams. so i wanted 2 make a cmd line script so as to counter the time n automate the whole process namely :
1)Powering on the comp.
2)auto-logging the comp.
3)connecting 2 internet
4)launching the download program (all 4 @ 2am or b4 2am)
5)disconnecting frm internet (@7.58am or after 7.58am next step in script as 2 disconnecting n shuting down comp.)
6)shutting down program n terminating its process
7)shutting down computer
the script i made is as follows :
rasdial [username] [password]
cd c:\specified path of the program 2 b launched
specific program.exe
cd c:\
rasdial /d
tsshutdn 10 /delay:5 /powerdown /v
shutdown -s -f -t 20
here the 1st m 2nd step namely powering on n auto-logging i have done through task scheduler (if it could be done by cmd line then it will be better as 2 perform everything through a single file), after task scheduler starts the batch file at a specified period of time the connection is done n program is launched perfectly but here is the main problem. after the program is launched cmd is stuck there meaning until i close the opened program it doesn’t go forward n execute next command.
n i don’t know how make it jump on n execute next cmd coz if it doesn’t goes 2 next command then it will not be shut b4 free time ends n internet disconnecting command cannot b executed n further sys. shutdown. it can b stopped by task scheduler but then whole batch file process is stopped n afterwards disconnecting n shutdown commands are not executed.
one more thing, i have stated tsshutdn n shutdown command for shutting down comp. as i read an article onn internet that shutdown command shuts windows but not the system n tsshutdn utility is build for servers which shuts down windows as well as powerdowns system. ur views
eagerly waiting for ur response
Is there anyway giving an options to user?
Let’s say, if user click/choose NO, the shutdown process aborted?
i use this during school, i got the ip adresses of all the computers in our computer lab, and when the teacher logs on to her comp, she accesses the grade software while we are working, and i turn hers off, as well as other kids.
i did this at school, i shut down the dude next to me’s com becaus he was an ass
No one can shutdown my computer.please tell me is there any password protect.
How do I give myself permission to shutdown the remote computer?
i have stated tsshutdn n shutdown command for shutting down comp. as i read an article onn internet that shutdown command shuts windows but not the system n tsshutdn utility is build for servers which shuts down windows as well as powerdowns system. ur views