Turn on or off a PC remotely

Turn on or off a PC remotely

Even if you are not in front of your PC, you can turn it off or on remotely using a special Windows command, which can be used on your local network or via the Internet. Provided you make some adjustments.

When you turn off your PC from the Start button > Power > Shut down, Windows does nothing but execute a command. In this case the Shutdown command which manages the computer’s power supply and which is accompanied by several options (turn off the PC, restart the PC, shut down the PC, etc.) with possibly a quick restart. Like all commands, Shutdown can be run from Command Prompt, Windows PowerShell, or from the Windows Run menu. And since it is nothing more than a command, nothing prevents you from transforming it into a shortcut on your PC to turn it off more quickly or from launching it remotely on your local network or through the Internet. In the same way, it is also possible to wake up a PC remotely. If using the commands seems too complicated, you can rely on free remote control software like Team Viewer, AnyDesk or UltraVNC.

If you’re tired of going through the Windows Start menu to shut down your computer, you can create a shortcut directly on the desktop to run this command. A double-click on it will be enough to launch it and shut down the PC.

  • Right-click a blank area of ​​the desktop, then choose New > Shortcut. In the window that opens, enter the command: %windir%System32shutdown.exe /t 10 /s and click on Next.
  • For our example, we told Windows to shut down the PC after a certain amount of time (thanks to the reference /t) set to 10 seconds (thanks to the reference 10/s).
  • Then enter a name for this shortcut and validate to finish.
28283312
  • The shortcut has taken place on the desktop. Double-clicking on it shuts down the PC after ten seconds.
28283313

The Shutdown command can also be run from another PC located on the same local network as the one you want to shut down. Convenient for shutting down the computer without having to stand in front of its screen. For this operation, you must know the user name and the password of a session of the target computer.

  • Computers communicate on the local network through connection ports. Also, first check that TCP port 445 (dedicated to file sharing) is open in the Windows firewall of the target computer. To do this, type Sign in the Windows search field and click on Control Panel in the displayed results. Click on System and security then to section Windows Defender Firewallclick on Allow an app through Windows Firewall.
28283315
  • Scroll through the contents of the window that appears. Up the line Sharing files and printers. Check this box if it is not already done and validate by OK.
28283316
  • Go back to the general Control Panel window and type Distance in the search field at the top right of the window. From the displayed results, click Allow remote access to this computer.
28283340
  • In the new window that appears, check the box Allow remote connections to this computer then click OK.
28283341
  • Finally, you also need to know the local (private) IP address of this PC on the network. If you don’t know how, read our article IP address: find your public address. Write down this address.
  • Go back to the PC from which you want to launch the remote shutdown procedure. In order to obtain the necessary rights to be able to execute a shutdown command on the target machine, you must execute a command net use which allows you to manage network shares. Type the keyboard shortcut Windows + R. In the window that appears, type the command net use \IP-of-the-target-machine. Then enter the user name of an administrator session of the target computer and validate. Enter the password for this same session and validate. The message The command completed successfully will be displayed.
28283342
  • Now is the time to use the Shutdown command. Still in the Command Prompt window, enter the following command: shutdown -s -f -t 10 – m \ IP-of-target-machine and validate.
28283343

The Shutdown command is associated with several elements:

-s : Turns off the computer. (essential)

-f : Forces running applications to close without warning.

-t xx : Sets a countdown in seconds

-m \ IP-of-target-machine : Specifies the IP address of the target computer.

  • To take advantage of more options with the Shutdown command type shudown /?
  • You can also take advantage of a graphical interface for this command. Enter like this shutdown /i.
28283367

Wake On Lan, as its name suggests, consists in waking up (to wake up in English) a computer remotely via the network, by sending a Magic Packet to the network card of the target computer. Attention. Not all network cards and all BIOSes are compatible with receiving Magic Packets.

Note the good addresses

For this operation, it is absolutely necessary that the source computer be on the same local area network (LAN) as the target computer, ie the one you want to turn on remotely. It is also essential that you know the Physical (MAC) address as well as the IP address of the target computer. To obtain this address, read our practical sheet MAC address: how to find the network identifier. You will also need to know the IP address of the remote machine on the local network. For this, read our article IP address: find your public address.

Check the network card

To check if your network card is compatible, type Management in the Windows search box and choose Device Manager among the results. Scroll down Network card in the window that appears, right-click on your Network Card then choose Properties.

28283371
  • The options vary according to the network cards embedded in the PCs. However, look for a tab Power Management or the words “Magic Packet”, “Wake On Magic Packet“, “Wake On Lan” or “Awakening“. Check that all the options concerning these elements are activated.
28283372
  • If you can’t find these options anywhere, you may need to update your network card. Take a look around the site All Drivers or on the website of your PC manufacturer to retrieve the most recent driver.

Check the BIOS

To check if your BIOS is compatible, enter the BIOS when starting the computer by tapping the appropriate key according to the BIOS. (ESC, F2, F5, F12, OF THE). Once in the BIOS, go to the power options (POWER) and activate the option Wake-on-Lanor equivalent.

28283452

Check Windows Firewall

open port 8900 in the same way as port 445 (see above).

prepare the alarm clock

Start by downloading a small piece of free Wake-on-Lan (WOL) software onto the source computer. Install it then launch it. Click on the button To add and fill in the fields according to the information collected above:

IP address: Local IP address (of the target machine)

MAC address: MAC address (of the target machine)

Mask: 255.255.255.255

Port: 8900

28283453
  • Select the computer in the list then click on the button Wake selection. Once the packet is received, the target computer should power on.

In theory, waking up from the internet is possible, just configure the router or the Internet box to redirect a UDP packet from a specific port to all the computers on the network. By sending the magic packet to your public IP address and the correct port via the WOL utility, your computer will wake up. A single setting of the box will be used for all computers, but each computer will be woken up independently of the others, thanks to its personalized magic packet.

ccn1