Command line
There is a command line version of WOL called WakeOnLanC.exe. It’s main purpose is to support the task scheduler, but it can be used for any reason to wake up and shutdown hosts just like the GUI. These are the command line options:
Command | Description |
---|---|
-s | shutdown, requires -m or -all |
-s1 | sleep, requires -m or -all |
-s4 | hibernate, requires -m or -all |
-r | reboot |
-w | wakeup, requires -m, -g, -mac, or -all |
use -mac and -agent to explicitly send WOL packet to specific IP | |
-l | listen for WOL packets |
-e | enumerate host list |
-p “xx” | specify path to machines.xml database * this works on the GUI also |
-msg | immediate message (example -msg -c “Shutting down in 10 minutes” |
-pw “xx” | change shutdown password for a machine, requires -m, -g or -all |
-h | display help |
Options | |
-t xx | time delay (xx = seconds). For shutdown and reboot commands. |
-f | Force files closed. |
-m xx | xx = machine name |
-mac xxxx | MAC address |
-g xx | xx = a group to startup or shutdown. |
-all | All machines |
-agent xx | xx = address of WOL agent if on remote subnet, use with -mac |
-c “xx” | xx = popup message for shutdown or reboot command. |
Command line examples
Shutdown machine named “LaMachine”, the comment will be “Power Failure”:
C:\>WakeOnLanC -s -m LaMachine -c "Power Failure"
Wakeup machine named “LaMachine”:
C:\>WakeOnLanC -w -m LaMachine
Wakeup machine by MAC address:
C:\>WakeOnLanC -w -mac 00:43:18:9E:8E:A0
Reboot “LaMachine”, force files closed, delay for 20 seconds:
C:\>WakeOnLanC -r -m LaMachine -t 20 -f
Listen for and display WOL packets on the local subnet, for troubleshooting.
C:\>WakeOnLanC -l
Hibernate all machines.
C:\>WakeOnLanC -s4 -all