OS

Wake on LAN: Wake Windows PC Remotely and Run Apps

Step-by-step guide to wake a Windows PC over the internet using Wake on LAN, configure BIOS/network, forward router ports, and trigger custom software on wake remotely.

1 answer 1 view

How can I remotely wake a Windows PC from sleep mode over the internet and trigger custom software to run?

I want to create a system where:

  • A Windows PC (preferred, or Linux) is in sleep mode (not hibernated or shut down).
  • A remote server sends an internet request.
  • The PC wakes up and runs my software (or a service that launches it).

What realistic mechanisms exist for this, considering a sleeping PC does not actively run applications?

Wake on LAN (WoL) lets you remotely wake a Windows PC from sleep mode (S3) over the internet by sending a “magic packet” to its MAC address, but it requires BIOS tweaks, adapter settings, and router port forwarding. Once awake, detect the WoL event using WMI queries or Event Viewer (Event ID 1 from Power-Troubleshooter) to trigger custom software via scheduled tasks or scripts—no constant polling needed since sleep mode keeps the network alive for these packets. Tools like WakeMeOnLan or APIs from your remote server handle the packet sending, making this reliable for home servers or remote work setups.


Contents


Understanding Wake on LAN for Remote Wake

Ever wish you could flick a switch from your phone across the country and have your home PC spring to life? That’s Wake on LAN in a nutshell. This tech sends a special Ethernet “magic packet” containing your PC’s MAC address 16 times over, which the network adapter listens for even in sleep mode (modern S3 state).

Why sleep mode specifically? Hibernation (S4) or shutdown (S5) powers down the NIC completely in Windows, killing WoL support—Microsoft confirms this explicitly. From sleep, though, the card stays powered, sipping just milliwatts while waiting. Over the internet? Your router forwards UDP port 9 (or 7) packets to the LAN. Realistic? Absolutely, but it demands precise setup. Laptops add Wi-Fi caveats—some support “Wake for Wi-Fi network access,” but wired Ethernet is king for reliability.

And the custom software bit? Windows logs WoL wakes uniquely. Query WMI for Win32_ComputerSystem.WakeUpType equaling 5 (“LAN Remote”), or watch Event Viewer. Hook that to a task, and boom—your app launches seconds after wakeup. No polling, no battery drain worries.


Enabling Wake on LAN in BIOS/UEFI

Start here, or nothing works. Dive into your motherboard’s BIOS (hit Del, F2, or F10 during boot—check your manual). Look under Power Management or Advanced > APM Configuration.

Common spots:

  • Gigabyte/ASUS/MSI: “Wake on LAN,” “PME Event Wake Up,” or “Power On By PCI-E/PCI.” Set to Enabled.
  • Integrated LAN: Toggle “Wake on LAN by PME” or similar.
  • UEFI vs Legacy: Modern boards need “ErP Ready” disabled sometimes, as it cuts power entirely.

PC Mag walks through this for various boards, noting trial-and-error for sleep states. Save, exit, reboot. Test locally first: Tools like NirSoft’s WakeMeOnLan scan your LAN and ping the magic packet. If it wakes from sleep, you’re golden. Laptops? Enable in BIOS too, but expect shorter battery life.

Pro tip: Document your MAC address now (ipconfig /all in CMD). You’ll need it for remote sends.


Configuring Wake on LAN in Windows Network Adapter

BIOS done? Head to Windows. Right-click Start > Device Manager > Network Adapters > your Ethernet card > Properties.

Power Management tab:

  • Check “Allow this device to wake the computer.”
  • Check “Only allow a magic packet to wake the computer” (blocks accidental wakes).

Windows Central has screenshots for Windows 10/11. Advanced tab: Ensure “Wake on Magic Packet” and “Wake on Pattern Match” are enabled. Realtek/Intel cards often hide these—update drivers if missing.

Power Plan matters: Settings > System > Power & Sleep > Additional power settings > Change plan settings > Change advanced > PCI Express > Link State Power Management > Off. Sleep timeout? Unattended Sleep Timeout to 0 via registry (powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_SLEEP UNATTENDED_TIMEOUT 0) prevents re-sleeping post-wake.

Linux alternative? ethtool commands like ethtool -s eth0 wol g persist WoL on S3.


Disabling Fast Startup for Reliable Sleep Mode WoL

Windows’ “Fast Startup” (hybrid shutdown) is the silent killer here. It hibernates the kernel on shutdown, putting NICs in D3 (off). Sleep? Fine, but avoid shutdowns.

Fix: Control Panel > Power Options > Choose what the power buttons do > Change settings unavailable > Uncheck “Turn on fast startup.” Microsoft details why WoL fails otherwise.

Now your PC stays in true S3 sleep. Test: Put to sleep, send local WoL. Wakes? Check Event Viewer > Windows Logs > System for Event ID 1, Source: Power-Troubleshooter. Description reveals “Kernel-Power” or “LAN Remote.”


Setting Up Router Port Forwarding for Internet Access

Local WoL rocks, but internet? Routers block unsolicited UDP by default.

  1. Find your public IP (whatismyip.com)—dynamic? Use DDNS like No-IP.
  2. Router admin (192.168.1.1 usually): Forward UDP ports 7/9 to your PC’s local IP (static IP essential, DHCP leases expire).
  3. Target: PC’s MAC, but routers forward to IP.

HowToGeek covers NAT quirks. Firewalls? Allow WoL ports. ISPs block? Rare, but VPNs complicate. Success rate? High for wired home setups.


Detecting WoL Wake Events to Trigger Software

Sleeping PC can’t run apps—fair point. But on wake, Windows fires events you can latch onto.

Event Viewer goldmine: Post-wake, filter System log: Event ID 1, Power-Troubleshooter. NinjaOne explains parsing it. Script: PowerShell Get-WinEvent -FilterHashtable @{LogName='System'; ID=1; StartTime=(Get-Date).AddMinutes(-1)} | Where-Object {$_.Message -like "*Wake Source*"}.

WMI magic: Seconds after boot, query:

Get-WmiObject -Class Win32_ComputerSystem | Select WakeUpType

5 = LAN Remote. SuperUser thread confirms.

Linux: systemd logs or ethtool status.


Automating Custom Software Launch on Wake

Detection hooked? Automate.

Task Scheduler:

  1. Create task > Triggers > On an event > Log: System, Source: Power-Troubleshooter, ID: 1.
  2. Filter XML: <QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Power-Troubleshooter'] and (EventID=1)]]</Select></Query></QueryList>
  3. Actions: Run your .exe or service. Delay 30s for full boot.
  4. “Run whether user logged on or not,” highest privileges.

WMI script in task: If WakeUpType=5, launch app. Stack Overflow example for startup diffs.

Services better for always-on: Install as Windows Service, event-driven.

Remote server integration? Webhook post-wake pings server, or vice versa—no, server sends WoL, PC calls home on wake.


Sending WoL Magic Packets from a Remote Server

Your remote server (AWS? Home VPS?) sends the packet.

Tools:

  • NirSoft WakeMeOnLan: GUI/CLI, custom ports.
  • Python: wol lib (pip install wakeonlan), wol MAC public_ip 9.
  • Apps: AnyDesk/Splashtop/TeamViewer have built-in WoL. AnyDesk setup.

Server script: Cron job or API endpoint. Public IP + port forward = instant wake. Test with ngrok for dev.

Linux server? wakeonlan package.


Troubleshooting Wake on LAN Issues

No wake? Checklist:

  • Wireshark capture: See magic packet arrive? (48-byte sync + 6-byte MAC x16).
  • Power settings: ARP offload enabled?
  • Wi-Fi? Spotty—switch wired.
  • Laptop lid? Unattended timeout 0.
  • Event log: Wake source “Unknown”? Adapter issue.

WinITPro.ru basics help Russian routers. Patience—iterate.


Sources

  1. Wake on LAN behavior - Windows Client | Microsoft Learn
  2. How to Remotely Turn On Your PC Over the Internet | HowToGeek
  3. Configure Wake on LAN (WoL) on Windows 10 | Windows Central
  4. Windows Wake-on-LAN from Sleep on Laptop | Super User
  5. Turn on Computer From Across the House With Wake-on-LAN | PCMag
  6. Windows - Different startup programs after wake on lan | Stack Overflow
  7. WakeMeOnLan | NirSoft
  8. Wake up a device remotely | AnyDesk
  9. How to use Wake-on-LAN (WOL) | Splashtop
  10. How to See Devices that can Wake Your Computer | NinjaOne

Conclusion

Wake on LAN nails remote waking from sleep over the internet—BIOS enable, Windows tweaks, port forwarding, done. Pair with Event ID 1 tasks or WMI for seamless custom software launches, turning your PC into a always-ready remote beast. Test incrementally, wired preferred, and you’ll ditch manual power-ons forever. Realistic, low-overhead, and battle-tested.

Authors
Verified by moderation
Moderation
Wake on LAN: Wake Windows PC Remotely and Run Apps