Do a Remote Shutdown for a PC on a LAN

Shutting down a computer you control remotely can come in handy sometimes. It's not a difficult process once you're connected to the target computer over the local area network (LAN) and know the appropriate shutdown commands. This can be very useful if you have multiple home computers (or want shutdown access to your work computer from home). Keep in mind you will need full administrative access to the target computer(s) before you accomplish the shutdown. If you’re on a home network, make sure all computers are in the same workgroup and that they all have at least one administrator account with the same username and password.[1]

Steps

Using the Command Prompt

  1. Enable remote registry on the target computer. First you'll need to ensure that the computer you want to remotely shutdown is set up to be remotely accessed and that both computers are a part of the same local area network (LAN). Search for services.msc and click enter to check or adjust these settings. Go to "Console" then right click "remote registry" and click "start".
    • If you need help in setting up the LAN, or connecting both computers to it then check out Create-a-Local-Area-Network-(LAN) or Configure-Your-PC-to-a-Local-Area-Network.
  2. Ensure that you have local administrator privileges. You must have administrator-level access on the target computer in order to shut it down remotely. If you are denied access to a computer you own it is likely because you lack sufficient local privileges. Read Find or Change My Computer's Administrator for more details on adjusting these privileges on the target computer.
  3. Find your computer's official name by right-clicking on Computer and clicking Properties. The name this computer uses for local networks will be found under the tab "Computer name, domain, and workgroup settings".
  4. Open the command prompt.
    • Click on the "Start" button
    • Select "Run" to access the prompt.
  5. Type in a shutdown code. An example of the correct code is .shutdown -m \\computername where "computername" is replaced by the name of computer you wish to shutdown (or the IP address).
    • Other codes exist as well: to learn about them type .shutdown /? in the command prompt.
    • For example, .shutdown –m \\worklaptop –c “The computer will restart, please save all work.” –t 60 will cause the computer with name "worklaptop" to begin a 60-second countdown before it shuts down and to display the message "The computer will restart, please save all work." on the screen.

Using the Remote Access Dialog Box

  1. Access the Run command window. If accessing the command prompt is a bit intimidating, pulling up the remote access dialog box is an alternate option for remotely shutting down a network computer. In most versions of Windows, "Run" will be accessible directly from the Start menu. If you're having trouble finding it, try searching for "Run" or using the keyboard shortcut Win+R to open it up.
  2. Type .shutdown -i into Run. This bit of code typed into "run" will bring up the remote access dialog.
  3. Enter the computer name or its IP address. The dialog box will appear and you simply need to fill in the appropriate information.
  4. Add a comment. On many versions of Windows, the remote access dialog box requires you add a comment to display on the target computer's screen. The comment can be anything you like.

Making a Batch File

  1. Create the batch file. A batch file is like a simple set of instructions you can prepare in advance and run at a later time (or again and again, whenever you need to). Go to "Notepad" and type in the commands you would have typed into the command prompt, for instance:
    .shutdown –m \\computername1 –r
    .shutdown –m \\computername2 –r
    .shutdown –m \\computername3 –r
    is a batch file intended to shutdown three separate computers upon execution.
    • Batch files are typically used for simplifying a series of repetitive tasks (e.g. shutting down a series of computers you control remotely, opening a series of software programs simultaneously).[3]
    • Batch files' strength are that they can execute a pre-determined series of commands in sequence with only one click.
    • For more detailed information on how to create a batch file, have a look at How to Write a Batch File.
  2. Save the batch file with a .BAT file extension. You will have to add this extension to the file directly by adding ".bat" to the end of the filename. When saving the batch file, choose "All Files for Save" as the type.[4]
  3. Run the batch file. The batch file is complete and can be run either by double clicking or by calling it by name the command prompt.
    • You can also schedule the batch file for later using built-in Windows utility "Task Scheduler.

Tips

  • You may also run this shutdown command directly from the "Run" dialog. Opening a command prompt is merely a convenience in case you happen to type in the wrong system name or need to search for the name of the system to shutdown.
  • Some other command options to add to your line of shutdown code in the command prompt include "-r" (forces a reset), "-t XX" (delays the shutdown by XX seconds), and "-c “comment”" (displays a comment on the target computer's screen).

Things You'll Need

  • Admin access the target computer(s)
  • Names or IP addresses of the target computer(s)
  • Internet connection

Warnings

  • IT departments typically block this type of access. Even if they do not, performing this may be grounds for disciplinary action or worse depending upon your IT department's policies.
  • Perform these actions only on your own network or elsewhere you are officially authorized.

Related Articles

Sources and Citations