Kioskea
Recherche
Ask a question »

Shutdown/Wake Up Lan - Turn your PC On/Off

March 2015


Is it possible to boot or turn off a computer remotely? Yes, this can be easily achieved if you are connected to the same local network as the target.
Given you're connected to the same local network and that you need to know the username and password, along with the firewall settings, this short article explains how to use the Shutdown command to turn off a PC remotely and also, how to use the WakeOnLan standard to wake or boot a PC.
Tested on Windows ®XP Professional

Shutdown a remote PC

Prerequisites

  • You must be connected to the same local network as the target PC.
  • You need to know the username and password.

Open port 445

Open the TCP port 445 on the target computer:
  • Open Start > Settings > Control Panel > Security Center.
  • Open Windows Firewall > Exceptions tab
  • Select the following line "File Sharing and printers" and press OK
  • If this line is missing, click on Add Port and choose TCP port 445
  • Then go to Star > Settings > Control Panel > System
  • Select the Remote tab, check Allow users to connect remotely to this computer

Open the Command Prompt

  • Go to Start/Run or use the keyboard shortcut: Windows + R
  • Type cmd and hit OK
  • The command prompt shall open

The net use command

  • To obtain the necessary rights to run a shutdown command on the target machine, you must first run the net use command.
  • net use \\ip_address_of_target_machine
  • Enter an username/password (aministrator) for the target computer

Shutdown command

Once connected to the target PC, we can run the shutdown command.
Example:
 shutdown -s -f -t 30 - m \\192.168.3.4

Where:
  • -s: shutdown the PC
  • -f: Force running applications to close without warning.
  • -t xx: Set a countdown in seconds
  • -m \\xxx.xxx.xxx.xxx : the IP address of the target computer.

In our example, the target computer will receive instructions to shutdown within a 30 seconds delay, closing all running application.

The GUI is available by typing: shutdown -i
  • To get additional information about this command, type: shutdown /?

WakeOnLAN

WakeOnLan, as the name already suggests, is a tool that can boot or wake a computer (on the same local network) by sending a magic packet to the network adapter of the target computer.
  • Note that: Not all network cards and BIOS are compatible or support the use of Magic Packet.

Prerequisites

You must be connected to the same local area network (LAN) as the target computer.
You also need to know the Physical Address (MAC) and the IP address of the target computer.

MAC & IP addresses

First, you must retrieve the IP address and MAC addresses of the target computer:
  • Go to Start/Run or use the keyboard shortcut: Windows + R
  • Type cmd and hit OK
  • The command prompt will open.
  • Enter the following command: ipconfig /all
  • Copy the IP and Physical (MAC) address of the target PC.

Network Card compatibility

To check if your network card is compatible with magic packets:
  • Right click on My Computer and click Manage.
  • Go to Device Manager/Network Cards.
  • Right click on your Network Card then Properties .
  • Search for the following the words: "Magic Packet", "Wake On Magic Packet", "Wake On Lan" or "Wake" - verify that all options related to these words are being activated
  • If you found nothing, you may be required to update the drivers of your Network card

BIOS

  • To check if your BIOS is compatible, follow these steps:
  • Enter the BIOS when you start the computer by pressing ESC, F2, F5, F12 or DEL, depending on your system,
  • Once in the BIOS, go POWER Options and enable Wake-On-LAN, or any similar option.

Open port 8900

  • Open port 8900 in the same way as port 445.

Wake On LAN (WOL)

  • Start by downloading the tool on the source computer: WOL
  • Launch the tool:
  • Fill in the empty fields using the information gathered above:
    • Mac Address: MAC address (the target machine)
    • Internet Address: Local IP address (target machine)
    • Subnet Mask: 255.255.255.255
    • Send Options: Local Subnet
    • Remote Port Number: 8900
  • Click the button: Wake Me Up

Note: Once the packet has been received, the target computer will boot.

Boot your PC from the internet

  • In theory, it is possible to boot a remote PC from the internet. You will need configure your router to redirect a UDP packet to a specific port on all the network computers.
  • By sending the magic packets to your public IP address (on the correct port) you will be able to individually boot computers on your local network.

Boot your PC using your phone

  • If you want to wake up your computer while you are not at home using your phone, you will need an external PSTN modem (using the RS 232 serial port). Connect the modem to your computer and enable the following option in your BIOS: For there connect the modem to IP phone line from your router.
  • The downside of using this method is that your computer will boot (if the modem is on) each time you receive a phone call!.
For unlimited offline reading, you can download this article for free in PDF format:
Shutdown-wake-up-lan-turn-your-pc-on-off.pdf

See also

In the same category

Encender / Apagar un PC de manera remota
By Carlos-vialfa on September 6, 2010
Computer aus der Ferne ein- und ausschalten
By jedtheboss on January 30, 2013
Como desligar/ligar um PC remotamente
By pintuda on August 20, 2010
Original article published by darkygame. Translated by Ambucias. - Latest update by Jeff
This document entitled « Shutdown/Wake Up Lan - Turn your PC On/Off  » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.