Shutdown or Wake Up a PC on a LAN

April 2017

In addition to serving as a host, a LAN (or local area network) also gives users a certain amount of control over the PCs that are connected to a network. Included in this is the ability to turn a computer on or off from a remote location

This article will explain how to use the Shutdown command to turn off a computer remotely as well as how to use the WakeOnLan standard to wake or boot a PC. 

This method was tested using a Windows XP Professional computer. 


Remotely Shutdown a Computer on a LAN

In order to control a computer remotely, please note that you must be connected to the same local network as the target PC. You must also know the username and password required for login. 

The first step is to open TCP port 445 on the target computer. To do this, open your Start menu and then go to Settings > Control Panel > Security Center

Open Windows Firewall and click the Exceptions tab. 

Select the line that reads File Sharing and printers and press OK. If this line is missing, click Add Port and choose TCP port 445 

Next, head to Start > Settings > Control Panel > System. Select the Remote tab and check the option that reads Allow users to connect remotely to this computer

It is now time to open the command prompt. 

Head to Start/Run or use the keyboard shortcut Windows + R. Next, type cmd and then hit OK. This will open your command prompt. 

To obtain the necessary rights to run a shutdown command on the target machine, you must first run the net use command. Use the Windows + R keyboard shortcut and then enter net use \\ip_address_of_target_machine. Enter an administrator username and password for the target computer to connect to the target PC. 

Once connected to the target PC, we can run the shutdown command. An example of the command is given below, whereby instructions are given for the target computer to close all active applications and shutdown after 30 seconds of inactivity. Please note that you can substitute any of the variables according to your network or PC specifics: 

 shutdown -s -f -t 30 - m \\192.168.3.4

-s: Shutdown the PC 

-f: Force active applications to close without warning 

-t xx: Set a countdown in seconds 

-m \\xxx.xxx.xxx.xxx: The IP address of the target computer 


The GUI is available by typing shutdown -i

For any additional information about this command, type shutdown /?

The WakeOnLAN Command

WakeOnLAN, as the name already suggests, is a tool that can boot or wake a computer by sending a Magic Packet to the network adapter of the target computer. It is important to note that not all network cards and BIOS are compatible with, or support, the use of Magic Packet

In order to use the WakeOnLAN command, you must be connected to the same local area network (LAN) as the target computer. Knowledge of the physical location (MAC) and IP address of the target computer is also required. 

Retrieve IP and MAC Address

The first step is to retrieve the IP address and MAC address of the target computer. To do this, go to Start/Run or use the keyboard shortcutWindows + R and type cmd > OK

The command prompt will open. Now type ipconfig /all


Copy the IP and physical (MAC) address of the target PC. 

Compatibility Checks

It's now time to check if your network card is compatible with Magic Packets. To do this, right-click on My Computer and click Manage. Next, go to Device Manager/Network Cards and do a right-click on your Network Card. Then click Properties

Do a search for the following words and verify that all options that relate to them are currently active: Magic PacketWake on Magic PacketWake on Lan, or Wake. If none of these words appear, you may be required to update the drivers for your Network Card. 

To see if your computer is BIOS compatible, enter the BIOS when you start the computer. You can do this by pressing ESCF2F5F12 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

You can open Port 8900 in the same way as you would Port 445

Wake on LAN (WOL)

Start by downloading the Symantec WOL tool on the source computer. Launch the tool and then 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 

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 option in your BIOS. From there, you can connect the modem to IP phone line from your router.

+ Recent posts