All » Tools » Windows | All Categories

Published on 05.18.06 by Brent Trahan

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

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.

Explore other guides about: AllToolsWindows.

Related Guides:

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

Subscribe to this guide's comments RSS feed.

  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.

    • newbie says:

      How do you add the user account of your computer on the networked computer and give it administrative rights? I’m trying to remotely shut down an XP Home from a Vista Home Basic through a wireless connection.

      Thanks,

      Newbie

  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?

    • Dwarka Yadav says:

      Hello,

      When are getting error network path is not found then
      have to start messenger service so it will solve this problem.

      thanks

  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. drew patel says:

    it says the network path was not found

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

  72. Brent Trahan says:

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

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

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

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

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

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

  78. bob says:

    well when i try to shutdown a second computer in the network it says the network path was not found and i think im typing it right im typing shutdown -m //mycomputer -s and when i try to do shutdown -i it says failed and i dont know how to change the passwords so could someone please help me???

  79. tee says:

    how do i shutdown the computer in the command prompt without bringing up the remote shutdown window?

  80. Brent Trahan says:

    Look under the section “Shutdown Command via Command Prompt”.

  81. Chester L says:

    I have been doing some of my own research on this item and thought I would share my findings. I have seen quite a few posts “My user name and password are IDENTICAL for both machines but I still get ‘Access Denied’!” The problem my be corrected by a registry change. See the steps below; I have 2 PC’s and a server at home running Vista/XP/Server 2003 and about 4 more XP machines running under VMWare and the shutdown command worked for all of them after changing this entry in the registry.
    1) Start – Run – CMD
    2) Type “Regedit” in ‘Open’ dialog box; hit enter
    3) In the registry editor navigate to:
    My Computer/hkey_local_machine/system/currentcontrolset/control/lsa (ensure you SELECT the ‘Lsa’ folder)
    4) find the entry for “forceguest”
    5) This entry will probably read “1″ (either Hex or Decimal); change the entry to “0″

    Hope this resolves the issue for some of you out there. It works great for me and I’m planning to write a script to shut down all the machines at once.

  82. eran says:

    this proeblem has nothing to do with the UAC on a vista computer

    actually i’ve got one computer running vista and another one with xp

    no problem to remote shutdown the vista (even with firewall and UAC)

    but i’m having a problem on the other way, can’t figure it out
    the xp computer would not turn off by the vista
    access denied, eventhough i tried all your solutions…. nothing works for me….

    i’m giving up…..

  83. eran says:

    as i said i was just about to give up…… when i came across with a solution somewhere….

    you can manualy add the user with the privilege to force a remote shutdown….

    on the computer you are about to turn off:
    Open Administrative Tools \ “Local Security Settings”. Navigate to Security Settings \ Local Policies \ User Rights Assignment. Double-click “Force shutdown from a remote system” in the right pane. Click “Add User or Group”. and add the computer that runs the remote shutdown command. make sure to do the checking.

    that works for me!
    hope its good for some people here…

  84. Bruce says:

    In referance to the remote shutdown. I found if you edit the local policy to allow selected users to shutdown the system you can accomplish the remote reboot option. I also added the shutdown.exe to the system32 folder. For testing I just added the everyone group to the local policy of the system. I know huge security risk but it works. I ran the following line:

    shutdown -m \\computername -r -f -d p:2:4

    The -d p:2:4 is for the 2003 servers and it won’t cause issues with 2000 servers, this enters a planned shutdown entry for the gui that pops up on the 2003 servers after a reboot.

    you could use:

    shutdown -m \\computername -r -t 30 -f -d p:2:4 -c “this computer will reboot in 30 seconds”

    You should be able to find the shutdown file on an 2003 server and copy to a 2000 server, just to keep the batch file simple.

    Another tip is you can type the comands in a word document, hit enter at the end of each command line. You can then copy and paste the infomation to a comand prompt and it will run each line in the sequence they were typed in the word doc. Just rember to hit enter after every command you want to run in the word doc.

  85. Bruce says:

    I just read tees post.

    You can use my earlier posted method. The command to shutdown teh computer would be:

    shutdown -m \\computername -f -d p:2:4

    This will force the open applications to close and shutdown the computer.

    The better option would be:

    shutdown -m \\computername -r -f -d p:2:4

    This reboots the remote box and forces the applications closed, both of these do not display any kind of window.

  86. Ken Wee says:

    i need help…i cant seem to use this guide. when i try to access the host pc from the network a password is being asked…but there’s no password in admin account of the host PC…how can i fix this…thanks…

  87. Brent Trahan says:

    Use Administrator as the user account and leave the password blank.

  88. Raj says:

    there are domain server and my pc is full admin rights . but i will shutdown any pc in my network but the arrer show. “the natwork path wad not found and access is denied”

    plz provied me solucation.

  89. sivaji n says:

    dear sir
    The below commend is used to locally shutdown

    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
    This is execuite my question is how can you shutdown 98 PC’s in Remotely

  90. seby says:

    I want to shutdown only the logged in users in the domain. I also want to get the list of the logged clients in the domain.

  91. Louis says:

    I want my users to have the option to abort the remote shutdown how can i do this? this is my batch file that works fine but can’t seem to get the -a option going

    shutdown -m \\computer1 -s -f

  92. Brent Trahan says:

    Your users would have to open the command prompt and type shutdown -a.

  93. ALex says:

    i tried using ure shutdown -i command and after i press ok i get this error on my command promp sayin… the network path was not found..? what am i suposed to do to fix it? and i do have admin rights on that computer

  94. KATHY P. says:

    My son put a disk in my computer.Then he didn’t shut it off properly.When turned on the screen it ‘ts black with white writing on it , saying disk reading error. I followed the instructions,yet nothing happened. I can’t get the menu to come up.I pressed f8 and others and Ivé turned it on and off as fast as I can.I’m in my 50s and new to this. Can you help me in a way I can understand? Thank you very much,Kathy.(I don’t mean that I have to understand you,, only what to press to fix the problem- no hightech words )

  95. Brent Trahan says:

    Try removing the disk and turn the computer back on.

  96. Jeff S says:

    Just sharing my experience with remote shutdown on WindowsXP Pro. First, in my case at least, the username and password does not have to be the same on both machines. I first used the command:

    shutdown -m \\computer -r -f

    and I received the Access Denied message. Relizing I was not being asked for a username and password I used Network Place and browsed to the machine I was wanting to shutdown, double clicked the icon, and then I was asked for username and password. Upon entering a valid name/password for the remote computer the above command worked like a champ.

    Basically, if you can browse anything on the remote computer, and you signed in using an account with admin rights, the above command should work.

  97. Drever44 says:

    I have a server running xp home sp3 with apachie2.2 server running and a workstation running xp pro sp3. On the server I have automated several routine tasks such as synctoy to update my network website from my workstation and ccleaner to clean the temps and also defragging all drives in that order even got it all to append to a log file on my workstation so I can monitor the progress of the updates and what not. Setup in the bios of the workstation timed and date to startup to allow all this to happen in the wee hours of the morning when I am less likely to be scripting or using the workstation.

    I have read this entire thread from top to bottom 3 times trying all possible suggestions and still I get an access denied either way I try to use the shutdown command from server to workstation and workstation to server. Audviously I am missing something here. Also have read other threads in regards to this problem and still nothing seams to work. Oh except if I choose the computer that I am executing the command on. Then it works fine, which is useless to me.

    I tried making a separate bat file on the machine to execute the shutdown command locally how ever like in one of the above comments I get an endless loop that I have to ctrl-c to stop. Thinking I could just call the second bat from the first.

    I have tried everything. Even got chin deep in the Microsoft tek notes on this subject and trying to figure out the privileges and got no where. I can access either machine in any way threw the network but still no luck with the shutdown command.

    This is Greek to me (I’m not Greek) perhaps you may shed some light on my issue and throw me a bone so to speak

    Both computer have same user names and passwords logged in. both users are administrators. and also diabled all firewalls and virous software.

  98. Karen says:

    I am a rookie at this. I have read you entire thread. I want to make sure I understand before I start trying to shutdown remote computers. I am on a network with a Windows 2003 Server, a Windows 2000 terminal services server (RDP), 20 clients running XP Pro.
    All my computers have an admin account with the same password.

    Not all my users have administrative rights, but there is an administrative account on the computers. Any user can be logged on to the remote when this remote shutdown is run and they will be logged off and then the computer will be shut down correct? I will be running the remote shutdown from my 2003 server nightly at about 8:00 pm. I would like to restart them at about 6:30 am. Is that possible?

    Why not just set up a batch file to run on each individual computer at a scheduled time? I know it would mean going to each computer and setting it up but I shouldn’t have the Access Denied errors.

  99. Brent Trahan says:

    It’s easier to maintain one big shutdown script than many shutdown scripts on a bunch of computers.

  100. John says:

    thanks for this

    I connected a vpn client on a remote machine (wasn’t thinking clearly) and couldn’t re-connect to it or reboot it.

    Logged in as an Admin on another machine and connected to the management console for the machine in question but the option to reboot was not available.

    However, I was able to kill the process for the vpn client, allowing me to reconnect and reboot.

    :)

  101. noj17 says:

    thanks for the info every one!

    i used both regedit methods and the local security setting and remote shutdown is now working..

    Regards,

    noj17

  102. yasser says:

    please help me in that

    i want run the command file befor my pc is shutdown
    and that file is for shutdown other pc at the same network
    and when i try to do that from ( gpedit.smc )useing a shutdown scripts
    its not working bec/ the pc is closeing all network services befor run the script file

    please help

  103. shino says:

    when i am trying to remotely shutdown the computer it says that th path is not found in your network

  104. Jerry says:

    O.K. So I am trying to shut down my classmates computers over the school network. Can I somehow shut down their computer becuase I don’t know their account name or password, but I know their computer name. We are on the same private network, so I figured this should work. PLEASE RESPOND

  105. Casper says:

    Im trying to shut down a Windows Vista Home basic PC from a Windows XP SP2 PC. When i give in the command: shutdown -s -f -m \\VistaPCName it says: “Network Path not found”. When i try it from the Vista PC to the XP PC it says: “Error (5): Access Denied” As far is I know there aren’t any firewalls on either of the PC’s. What’s the problem?

  106. Dee says:

    Hi everyone, I saw a question before that asked how to turn off a computer via Internet and you replied saying thatis possible and that you need to have an static IP and a router that can forward ports, I have both and I need to do it, because I have a computer in one country and the other in a diferent country and sometimes Ineed to turn off or restart one of them, so I don’t know if you can help me with this
    How I can turn off the computer using Internet
    PLEASE!!!!

  107. Brent Trahan says:

    I’m not sure which port(s) are used. Anyone know?

  108. Dee says:

    I was trying with the port 3210 and forwarding it to the computer I want to shutdown, but I was using a software (Poweroff) but it doesn’t works, I don’t know if there is another way to do it or maybe over the Internet I can shutdown a machine????

  109. andrew says:

    when i try to do it it say network path can not be found i can open there network threw run and everything the name is right but still cant shut it down

  110. add4 says:

    hi Brent Trahan, your explanations are very cleare and it works fine. but i have a software that accepts a remote user name and password if the name and/or password of the sender do not much. I want to send remote user name and password to shutdown. Any one can help me?

    Thxs.

  111. Jones Smith says:

    Exits software tools for easy and free make remote computer shutdown, one of the best software tools can be find here :


    http://enc.idraconnectivesolutions.com/

    It works on windows vista OK, i have test it and it is exelent

  112. Sunny-blue says:

    Hi, is there any way to logoff the computer in a given time? example, if I want the computer to logoff automaticaly for me after 30minutes after I log on. Is it posible? tnx very much…

  113. Don says:

    Hello,

    I have a Telnet server running on my Vista machine. When I telnet into the machine using NTLM to an Admin account, I get “Access is denied (5)” when trying to run the “shutdown /r” command. If I disable UAC on my host machine, the command will run, otherwise, I get the error. How do I run an elevated command prompt on Vista via telnet to an Admin account?

    Thanks so much!

    Don

  114. Dave says:

    I am revisiting batch files since using them in win 98, I have got 2 pcs hooked up over network, one is vista and the othr is xp, I generally run the vista one but backup to the xp one however I want remote shutdown so when I finish backing up I can close the other pc down.

    I have tried the various switches but to no effect, tried both -s -m and Shutdown /s /m [\\MARGARET] but still not working, if I run the batch I don’t get any errors but the other pc is still on as I can browse the drives across the network.

    Any suggestions?

  115. Don says:

    Hi Everyone,

    I found a work-around for my issue above.

    1) Install the Telnet server (and, to test, the Telnet client) on your home Vista machine. See the following website for more details:

    http://windowshelp.microsoft.com/Windows/en-US/help/81b6d4b7-905e-4d70-8379-7934913fedb01033.mspx

    2) Create an account (for me, this was another Admin account) on your home Vista machine that is identical to your remote machine. Same user id, same password. I connect to my home Vista machine from my work XP machine.

    Part II to follow…

  116. zeeshan says:

    hello,
    i not able to restart remote computer with shutdown -m \\ Computer name -s

    Access Denied reply in CMD

    what should i do to restart my LAN Local PC

    Thanks

  117. zeeshan says:

    hello,
    i not able to restart remote computer with shutdown -m \\ Computer name -s

    Access Denied reply in CMD

    what should i do to restart my LAN Local PC

    Thanks

  118. mtsamuel says:

    I am trying to use a bat file to shutdown a remote machine through shutdown script but not executing, same file is working in double click

    command is shutdown -m \\computername -s

  119. mtsamuel says:

    Hello Brent,

    if the problem with the static IP it should not work with double click too.

    Any suggestion??

    Thank you

  120. Jim says:

    @zeeshan
    if you get access denied message, then try using the real administrative account on the computer you want to shutdown. To do so, just type

    net use \\computername /user:admin-username

    at the command prompt. replace admin-username with username that have administrative privileges in the computer. then you will be asked for password, type the password or leave it blank if that user doesn’t have password. It worked for me.

  121. [...] Can you see them on your network (in networked computers)? If so you can have some fun with this…. Or if they have any files or folders shared you can hop on to [...]

  122. shyaam skilled says:

    um brent when i use shutdown-i it work until it closes and comes up in cmd as access denied how do i get around this?

  123. Don says:

    Part II…

    3) On your home Vista machine, I would highly recommend disabling the ‘passwd’ access option. See the following for more details:

    http://technet.microsoft.com/en-us/library/cc772455(WS.10).aspx

    After doing this, change someone (namely, you) could only connect to your Telnet server via NTLM authentication, which means that any hacker would need to know *both* your username and your password. IMHO, you could open up your telnet server to the World and be perfectly safe. Any potential hacker would not get any response when trying to connect to your Telnet server. For extra security, you could also change your Telnet port from 23 to some other port number.

    4) Download the following program and store it in the “base” directory of the account that you created in Step 2:

    http://www.vistashutdowntimer.toflo.de/

    5) If you need to reboot your home machine remotely and cannot connect to it via Remote Desktop, telnet to it and then run the following command:

    Vista-ShutdownTimer.exe NCH0IY

    More command-line options are here:

    http://www.vistashutdowntimer.toflo.de/eng/VistaShutdownTimer_Info.html

    You may try adding the ‘F’ option if the above command does not work.

    6) Wait 5 (or 10, for me at least!) minutes and then reconnect to your home machine via Remote Desktop!

    Cheers,

    Don

  124. CRYSTAL says:

    Good morning, I have administrator rights on a computer that I brought home from work after having major surgery so I can do my work at home. My I.S. team has been over a week getting back to me on this issue…..HOW do I change my login server, so I can actually log in and get some work done? It keeps sayingmy username or PW is invalid, but I know its because the server doesnt match, and I cant go to (at least I thought it ws f10) command prompt and safe mode doesnt seem to do a thing. Any ideas that can help? I am desperate?! Thank u!

    • Brent Trahan says:

      It’s probably not going to let you log on because it can’t contact the domain controller.

      If you don’t know the log on info for a local account on the computer you’ll have to contact your IT people for help.

  125. Munikumar Pattem says:

    Helloo Everyone,

    Can some one tell me how to logoff remote desktops forcely by using batch.

    Requirement:

    If any one is logged in to any remote machines i need to forcely logoff those users by running any batch. There are nearly some 50 remote machines.

    • Munikumar Pattem says:

      Helloo,

      my requirement:

      every friday we used to do code push in to the remote desktops some times some users will be using the remote desktops. I need to logoff those users at once by running any batch.

      Can some one tell me how to do this by using batch??

      It will be very thankfull if some one answer for this question.

      i will be waiting for reply

      thanks in advance.

      • DSM says:

        Hey, Bats are easy… and effective on computers that allow them…

        This is a rough idea and the easiest way to do it:

        OPEN NOTEPAD

        type in

        start shutdown.exe -m \\computername -m \\computername2 -s -c “This computer is about to be logged off. Please save your work. You have approximately 3 minutes to save or you WILL lose your work.” -t 180
        break

        then go to file, save as and type in a file name followed by .bat. eg. filename.bat

        Then you change the .txt in the dropdown to all files. Then hit save. This show now be a batch file that runs fine… i might have some flaws but they are easily fixed.

Leave a Reply

Subscribe to this guide's comments RSS feed.

Microsoft Windows is a registered trademark of Microsoft Corporation. Microsoft Corporation in no way endorses or is affiliated with MAXIMUMpcguides.com. All other products mentioned are registered trademarks of their respective companies. MAXIMUMpcguides IS NOT RESPONSIBLE for any damage or data loss to your computer from using this web site. All information on MAXIMUMpcguides is provided on an AS IS basis with NO WARRANTIES.

Copyright 2006-2009 Brent Trahan. All rights reserved.