Use the Remote Shutdown Tool to Shutdown, Restart, or Logoff a Local or Networked Computer

Posted on: 05.18.06 by Brent Trahan

This guide shows you how to use the shutdown command and its various switches to shutdown, restart, or logoff local or networked computers from the command prompt, dialog window, or batch file.

This guide shows you how to use the shutdown command and its various switches to shutdown, restart, or logoff local or networked computers from the command prompt, dialog window, or batch file.

What can the shutdown command do?

The shutdown command can be use via the command prompt, the remote shutdown dialog window, or in a batch file.  You can logoff, shutdown, or restart a computer with this tool.  You can even set the shutdown tool to perform a task at a certain time on certain days and to many computers at one time using a batch file.

This is a good tool to easily shutdown or restart lots of computers on a network at one time.  It can also be handy for helpdesk technicians when fixing remote computers.

Shutdown Command via Dialog Window

Typing commands in a DOS window is not what most computer users want to fool with so I’m going to start by showing you how to use the dialog window to use the shutdown tool.

To open the dialog window click start, click run, type cmd and press enter.  A black DOS looking window will open.  Type shutdown -i and press enter.  A window similar to the one below will popup.

Under computers type the network name of the computer you want to shutdown, restart, or logoff.  In this example I will use \\yourcomputer.  You can use your computer’s name to try the commands on your computer if you like.

If you don’t know a computers name right click my computer, select properties, select the computer name tab.  Your computer name is listed next to full computer name.

To send these commands to other computers across your network you need to have administrative privileges on those computers.  An easy way to see if you have administrative privileges on a networked computer is to try browsing to it.  Click start, click run, type \\yourcomputer (replace yourcomputer with your computer’s name of course) and press enter.  If you are able to access the computer you will be able to send shutdown commands to it.  If you get asked for a password or it denies access you don’t have administrative privileges and you won’t be able to send shutdown commands to that computer.

In this example I’m going to shutdown computer \\yourcomputer on my network.  Before it shuts down it’s going to show a message for 20 seconds.

The first thing you need to do is add which computer you want to shutdown.  Click add and type your computer name in the add computers box.

You can send the command to multiple computers by pressing enter after the name of each computer and typing the name of the next computer on the next line.  Each computer needs to be on its own line.

Click OK when you are finished adding the computer(s) you want to send the command to.

Under what do you want these computers to do: tell it to shutdown, restart, or logoff.

If you want a box to popup on the computer(s) you are sending the command to that lets them know the computer is about to shutdown, restart, or logoff in X many seconds leave warn users of the action checked off.  If you want to change how many seconds to countdown before performing the action you can change that next to seconds.

You can tell a user on the computer you are about to perform the action on why you are performing that action by typing your message in under comment.

Click OK to send the command to the computer(s).

If you get an error when sending the command it will look like the one below.

Shutdown Command via Command Prompt

The shutdown command becomes more flexible and automated when used from the command prompt.  To run the shutdown command from the command prompt, go to start, run, type cmd, and press enter.  In the black box (the command prompt) type shutdown and the switches you want to use with the shutdown command.  You have to use at east one switch for the shutdown command to work.

The Switches

The shutdown command has a few options called switches.  You can always see them by typing shutdown -? in the command prompt if you forget any of them.

-i: Display GUI interface, must be the first option
-l: Log off (cannot be used with -m option)
-s: Shutdown the computer
-r: Shutdown and restart the computer
-a: Abort a system shutdown
-m \\computername: Remote computer to shutdown/restart/abort
-t xx: Set timeout for shutdown to xx seconds
-c “comment”: Shutdown comment (maximum of 127 characters)
-f: Forces running applications to close without warning
-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)

Please note: I’ve noticed using a switch with a - sign doesn’t work sometimes. If you are having trouble try using a / in place of - in your switches.

Examples

shutdown –m \\computername –r –f  This command will restart the computer named computername and force any programs that might still be running to stop.

shutdown –m \\computername –r –f –c “I’m restarting your computer.  Please save your work now.” –t 120  This command will restart the computer named computername, force any programs that might still be running to stop, give to user on that computer a message, and countdown 120 seconds before it restarts.

shutdown –m \\computername –a  This command will abort a previous shutdown command that is in progress.

Using a Batch File

You can create a file that performs the shutdown command on many computers at one time.

In this example I’m going to create a batch file that will use the shutdown command to shut down 3 computers on my home network before I go to bed.

Open notepad and type the shutdown command to shut down a computer for each computer on the network.  Make sure each shutdown command is on its own line.  An example of what should be typed in notepad is below.

shutdown –m \\computer1 –s
shutdown –m \\computer2 –s
shutdown –m \\computer3 -s

Now I’ll save it as a batch file by going to file, save as, change save as type to all files, give the file a name ending with .bat.  I named mine shutdown.bat.  Pick the location to save the batch file in and save it.

When you run the batch file it’ll shutdown computer1, 2, and 3 for you.

You can use any combination of shutdown commands in a batch file.  I just used the one above as an example.

Still need help? Ask Your Computer Question Now.

78 Responses to “Use the Remote Shutdown Tool to Shutdown, Restart, or Logoff a Local or Networked Computer”

  1. mazterpeaces Says:

    hello,why when i try to restart other network computer in command prompt will dispaly “ACCESS DENIED”…plz tell me how to settle this problem..tq

  2. Brent Trahan Says:

    The user account on your computer doesn’t have administrative rights on the networked computer.

    Try adding the user account of your computer on the networked computer and give it administrative rights.

  3. Nathan Says:

    Is it possible to shutdown a computer that isn’t on your server, from your computer, through the command prompt?

  4. Brent Trahan Says:

    What do you mean by “isn’t on your server”?

    As long as you’re logged in with a user that has Admin privileges on the remote computer you can shut it down from the command prompt.

  5. josh Says:

    all of the PC’s on my network have a default admin account. When I sign into this account on my PC and try to shut a PC down remotely I still get access denied. What else can I do to get this to work?

  6. Brent Trahan Says:

    Maybe I’m not making this clear enough. Let me try to explain this again.

    The computer sending the shutdown command to a networked computer needs to be logged in as a user with administrative privileges on the computer receiving the shutdown command in order for the shutdown command to work. The user name and password have to match on both computers.

    For example: Computer A wants to send a shutdown command to computer B across a network. Computer B has a user account called Administrator with a password of letmein. In order for computer A to be able to successfully send the shutdown command to computer B computer A must be logged in as Administrator with the password letmein .

  7. Raymond Lim Says:

    Thank you vary much, Mr. Brent Trahan.

    Your explanation for remote or batch command shut down is clear enough to understand & it is vary useful for me to do auto remotely PC shut down.

    Thanks again.

    =)

  8. doN Says:

    ok the only thing i want to know is that how do i give the other pc a network administrative rights??

  9. Jimi Says:

    hi, my problem is it asks for a network path. how would i find this?

  10. Aquib Says:

    all of the PC’s on my network have a default admin account. When I sign into this account on my PC and try to shut a PC down remotely I still get access denied. What else can I do to get this to work?

    i tried this procedure also
    Computer A wants to send a shutdown command to computer B across a network. Computer B has a user account called Administrator with a password of letmein. In order for computer A to be able to successfully send the shutdown command to computer B computer A must be logged in as Administrator with the password letmein .

  11. Aquib Says:

    all of the Computer on my network have a default admin account. When I sign into this account on my Computer and try to shut a Computer down remotely I still get access denied. What can i do?

    i tried this procedure also
    Computer A wants to send a shutdown command to computer B across a network. Computer B has a user account called Administrator with a password of letmein. In order for computer A to be able to successfully send the shutdown command to computer B computer A must be logged in as Administrator with the password letmein .

  12. Aquib Says:

    all of the Computer on my network have a default admin account. When I sign into this account on my Computer and try to shut a Computer down remotely I still get access denied. What can i do?

    i tried every procedure but it is impossible

  13. Aquib Says:

    all of the Computer is on my network have a adminstrator account. When I sign into this account on my Computer and try to shutdown a Computer remotely I still get access denied. What can i do?

    i tried every procedure but it is impossible

  14. Aquib Says:

    all of the Computer is on my network have a adminstrator account. When I sign into this account on my Computer and try to shutdown a Computer remotely I still get access denied. What should i do?

    i tried every procedure but it is impossible

  15. Kevin Says:

    do u have to type in the “1 2 and 3″ in the \\computersname if u want to shutdown more than one at a time?

    heres what u said:

    shutdown –m \\computer1 –s
    shutdown –m \\computer2 –s
    shutdown –m \\computer3 -s

    so do u need those numbers in there? or do u just need the computer names?

  16. Brent Trahan Says:

    Computer1, computer2, and computer3 are examples of computer names on a network.

    Replace computer1, computer2, and so on with the names of computers on your network. Examples: Bedroom, Livingroom, FileServer.

  17. Bert Says:

    I cannot get the -c switch to work.

    I have used <> in the command line and as a scheduled task. The comments don’t work in either, but it works correctly otherwise. ie It shuts down at the correct time with the correct wait period.

    also, when trying to use a .bat the command is entered hundreds of times in an infinite loop.

    I am using XP professional.

  18. Brent Trahan Says:

    You need to place your comments in “quotation marks” not <>.

    What is in your batch file? Type it out here exactly.

  19. Bert Says:

    oops, I used double <’s to enclose what I had in the command line and it killed it all. It should say “shutdown -s -f -t 120 -c “This computer will shutdown in 2 minutes. Save your work”"

    my batch file is

    shutdown -s -f -t 120 -c “This is a test”

  20. Brent Trahan Says:

    I created a batch file with shutdown -s -f -t 120 -c "This is a test" and it worked on my Vista PC.

    Try replacing the - with / in the command and let me know.

  21. Bert Says:

    shutdown /s /f /t 120 /c “This a test” still results in an infinite loops in the batch. I think using a timer might not work for batches.

    In the command line it works, but there is still no comment.

    I’ve just noticed that a separate window appears for an instant when using the command line. I suspect that window has the comment in it but for some reason it closes instantly.

  22. Brent Trahan Says:

    Add another line to your batch file and type PAUSE.

    After the command is run it will pause and let you see any errors in the DOS prompt.

  23. Bert Says:

    pause in the .bat file seems to do nothing.

    a simple .bat consisting of only

    dir
    pause

    works fine though.

    I tried shutdown -s -t 120 -c “testing”|pause in the command line. It shows the message “press any key to continue…” like expected, but does not actually pause the program. (the | operator may not do what I think it does in windows)

    The instantly appearing and disappearing box is with the command line only; the batch file shows the command line window but continually scrolls E:\Documents and settings\bert\Desktop\shutdown -r -t 120 -c “testing”

    I am beginning to think there is some seemingly unrelated setting somewhere that is interfering with things.

  24. Brent Trahan Says:

    You should only have one line in your batch file that goes exactly like so:

    shutdown -s -f -t 120 -c “This is a test”

    Don’t use |.

    If you want to pause the batch file to see any errors type two lines like so:

    shutdown -s -f -t 120 -c “This is a test”
    PAUSE

  25. Bert Says:

    That’s what I have. I used the | in the command line only.

  26. rob Says:

    the remote computer on my network has multiple user accounts; 1 guest, 2 admin accounts which are password protected and 1 admin account which is not password protected, i have an admin account on my pc which is password protected, what do i need to do to shut down the other pc from my own??

  27. Brent Trahan Says:

    You need to be logged in with an admin account on your local computer that has the exact name and password (if any) as the remote computer you’re trying to shut down.

  28. nimbus510 Says:

    I am having issues with this and I cannot figure out why. I’m running a large closed network with 1 server and 15 clients. I want to use a batch file to restart all of the clients at once rather than me going all around the building and restarting them one at a time.

    The server is logged in as Administrator and has access to all of the clients. The clients all use an account called CG_user. They all still do however have an Administrator account as well which uses the exact same password as the server’s administrator account.

    When I use the remote shutdown command I get simply get the message that access was denied. What am I missing here?

  29. Brent Trahan Says:

    It seems like it should work to me. What version of server and clients are you using?

  30. Nimbus510 Says:

    Server is running Windows Server 2003, clients are on XP pro.

    I also have been trying to experiment with this in the office over a closed network of 3 other computers, all logged in as Administrator with the same passwords, and mine as well…and I STILL get “Access is Denied.” What am I missing!?!? All computers are capable of accessing eachother’s files, remote desktop, etc, but remote shutdown is not possible! Very frustrating.

  31. Brent Trahan Says:

    Do you have a firewall on any of the computers?

  32. roise_r Says:

    what i didn’t get still is: why it keeps saying to me Access is Denied, when still trying to shutdown remote computers with the same OS, the same admin account, and the same password, as the computer i am sending the command from…? it works, on all other computers in the room, except 4 of them… so i got it working for almost all computers in the room

  33. roise_r Says:

    …and i don’t know why, if i write a batch file… it keeps disregarding my options, meaning if i say: “-r -f” … it will only shutdown it without forcing application quit, and NO restart, just shutdown?????????

    this is an example of my batch file, (just like if i would write a command in the command promt):

    shutdown -m \\room106-pc12 -r -f

  34. Brent Trahan Says:

    I’ve come across computers that had software that wasn’t letting them shut down until it was properly closed or logged out. Check and see if you have any of that going on.

    Can you run the shutdown command locally on the 4 computers that don’t shutdown with the batch file?

  35. Rob Says:

    shutdown -m \\Laptop1a -s -f

    why doesnt tis work
    i think i have the admin rights cos i can acces the folders on that laptop if i do Start|Run|laptop1a

  36. Brent Trahan Says:

    Just because you can access a folder doesn’t mean you have admin rights.

  37. rakesh Says:

    Is there any command to remotely logoff a user from the machine.

  38. Austin Says:

    I do not understand. I went to run typed CMD and then i typed: shutdown -i after i typed that i added a computer and when i clicked log off it logged me off my computer instead of my other computer??? did i do something wrong?

  39. GiacJr Says:

    Hi brent! I love your tutorial, but I have quite a few problems. Please send me an email at giacjr@gmail.com with an IM address so I can explain them in length and get a quick reply. Thanks brent!

    GiacJr

  40. Brent Trahan Says:

    @ rakesh: Yeap, look under the switches section of this guide.

    @ austin: You can’t log off a remote computer.

    @ giacjr: Use the contact page to send me an e-mail about your problem and I’ll see what I can do.

  41. RolfW Says:

    regarding Bert’s problem with the loop.
    Try to rename the commandfile to something different from “shutdown”.

  42. Nestea_Zen Says:

    For all of you getting the ‘Access denied’ message, you need ntrights.exe (for Home Edition) to edit XP’s security policy. (If you have the pro version you can do it with run>secpol.msc> Force shutdown from a remote system.)
    The command would be (run>cmd)
    ntrights -u Guest +r SeRemoteShutdownPrivilege
    If the guest account isn’t active use
    ntrights -u Interactive +r SeRemoteShutdownPrivilege

    I can’t provide the registry entry because I don’t know where the ‘User Rrights Assignment’ entries are stored.
    ntrights can be found at

  43. jyesj Says:

    dear thnanks for this fantatistic post but i have windows 2000 professional, when i type shudown -i in ms dos prompt it says it did not recognize command intenal or external what may be the reason moreover is it only for win xp.

  44. jyesj Says:

    what abt win2000 its not working shows not recognize as internal or external dos command

  45. Brent Trahan Says:

    This command isn’t included with win2000.

  46. Robert M Says:

    I was getting an access denied as well. However, when I went to the NetBIOS name (\\computername) it gave me an access denied because the clock was not synchronized with the primary domain controller. If you cannot access the machine using NetBIOS the shutdown command will not work. Just something to check for the people experiencing access denied.

  47. Brent Trahan Says:

    Thanks for that tip Robert.

  48. steven Says:

    can you shut down a computer with vista from a computer with xp?

  49. matt Says:

    I am trying to use this command as a batch file on my server. I want to be able to set it up as a sheduled task for the evening, so when i go home i know that any computer still on will be shut down by say 7pm. When i test with the script nothing happens. What am i doing wrong.

  50. Galaxy Says:

    Does command shutdown can be use on local PC with User account or only with Administrator rights? I’m using XP Home edition and don’t have to much possibilities.
    I’m tryed to shutdown PC with batch file or planned task
    with user right doesn’t work. Is anyone could help?

  51. Sandro Castillo Says:

    Hi,

    I trying to perform the following through a batch file and everything works fine, the only question I have is why don’t machines shutdown if they are locked? Shutdown does not occur if a workstation is locked.

  52. Brent Trahan Says:

    Try adding the -f switch to shutdown locked computers.

  53. Connr Says:

    Ok, I have an administrative account on my computer. I do not know if i have an administrative account on my network. How do i get admin privlages on my network? And how do i get rid of Acces denied? MY computer im using to shut the other computer off is Vista. The PC taking the remote shutdown is XP. Why do i get access denied?

  54. Brent Trahan Says:

    Lets say the administrative account on your XP computer is called User and the password is password. In order for the shutdown command to work, the user on your Vista computer must have the account name of User with the password password also.

  55. CryingFreeMan Says:

    where can i find admin account?? working on win 98???

  56. CryingFreeMan Says:

    This command isn’t included with win98???

  57. Brent Trahan Says:

    Windows 98 users type the following in the DOS box:

    RUNDLL32 SHELL32.DLL,SHExitWindowsEx n

    Where n is replaced by a number from the list below:

    0 Logoff
    1 Shutdown
    2 Reboot
    4 Force
    8 Poweroff (if supported by the hardware)

    An example command to reboot a Windows 98 machine would be:

    RUNDLL32 SHELL32.DLL,SHExitWindowsEx 2

  58. Matt Says:

    I was just wondering i’m a teacher at a school and we have computers in our library. I have been seeing students on sites that they are not suppose to be on. So can I shutdown thier computer from mine? All the computers are in the same network. Is that all I need is the computers full name.

  59. sarvesh Says:

    my pc restarts when i shut it down…..
    if i click on the turn off button it automatically restarts…..
    tell me what to do

  60. CryingFreeMan Says:

    Windows 98 users type the following in the DOS box:

    RUNDLL32 SHELL32.DLL,SHExitWindowsEx n

    Where n is replaced by a number from the list below:

    0 Logoff
    1 Shutdown
    2 Reboot
    4 Force
    8 Poweroff (if supported by the hardware)

    An example command to reboot a Windows 98 machine would be:

    RUNDLL32 SHELL32.DLL,SHExitWindowsEx 2

    WHAT IF IN NETWORKPLACES??

  61. Brent Trahan Says:

    That won’t work across a network. Only the shutdown command.

  62. CryingFreeMan21 Says:

    what command will work across a network?? i try the remote shutdown dialog it won’t work it say’s access denied?

  63. CryingFreeMan Says:

    Can you give the command for windows 98 for how to shutdown network computer’s!??

  64. Willie Says:

    is it possible to shutdown a pc over the internet? The remote computer doesn’t have a administrative password. I hope my questions will be answered. Thanks.

  65. soniya gupta Says:

    hello,why when i try to shutdown other network computer in command prompt will dispaly “ACCESS DENIED”…plz tell me how to settle this problem..tq

  66. Brent Trahan Says:

    Yes you can shutdown a computer over the internet but I highly discourage that, especially if the administrator account doesn’t have a password. If you allow your computer to be shutdown from the internet you open up your computer to the world. It’ll be hacked in no time.

    To shutdown a computer across the internet you’ll need a static IP address, and a router with the ability to forward ports. Most people with residential internet don’t have a static IP.

  67. Turker Yilmaz Says:

    For the case of VISTA network, although you have the same account in the remote computer with administrator privileges, if the remote computer has UAC enabled then you’ll get “access denied”. Disable UAC from the remote computer and send the command as explained in this thread.

  68. Turker Yilmaz Says:

    By the way, the UAC must be disabled from the remote computer account with the same name that you are trying to shutdown from your local computer.

  69. kamlesh Says:

    hi
    i want for u that my local user give time for work after the time complte then the computer shutdown (pc)give time the pc is start only

  70. Brent Trahan Says:

    Try setting up time limits.

  71. drew patel Says:

    it says the network path was not found

  72. Wim Says:

    Dear Brent,

    First of all I would like to compliment you on answering all questions people ask you. Great job!

    My question is: I want to shutdown 72 computers by batch. I created batchfiles containing 10 computers to shutdown. But, when a computer is not turned on, the batchfile, or rather the shutdown command, will wait for appr. 1 minute before proceeding to the next computer.

    Is there a way of minimizing that delay time?

  73. Brent Trahan Says:

    Not that I know of. I’ll check on that for you Wim.

  74. Dave Says:

    I’m still not having any luck trying to restart a VISTA machine from an XP box.
    I shut off UAC and the firewall on VISTA.
    Created a user with the same name on the XP box.
    I’m still getting the Access Denied message when sending the shutdown command from a command window.

    did I miss something?

  75. Brent Trahan Says:

    I haven’t had a chance to test this on Vista yet, but a previous comment on this guide says UAC needs to be turned off in order for the shutdown command to work. I’ll check on this when I get a chance.

  76. Omar Says:

    Ok, I’m still having trouble with this. I do everything exactly you said and everything works, except when i type in the computer name of the computer i want to shutdwon it still doesn’t work. i go to add computer and type in \\(the computer name) then press ok do everything i want and press ok and it says failed. what do i do? do i take of the period at t he end if the computer name has a period? I do have administration rights on this computer i even went to start>run>\\(my computer name) and it works. Please help me out

  77. Amrit Says:

    i have 50 pc in my network all in domain but not login in domain all login in administrator.so can i do the remote shutdown or restart any pc…..

  78. Brent Trahan Says:

    Sure. As long as the administrator account on all 50 PCs use the same password as the computer you’re using to remotely shut them down.

Follow this guide's comments via RSS.

Comment pictures provided by Gravatar.

Leave a Reply

No Support Questions If you have a support question please ask it in the forum.