WOL works perfectly well via the Router, but that requires logging in to the control and browse trought the menus. I want to wake up the machine with one (double) click.
I tried
- https://www.itprotoday.com/compute-engines/q-how-can-i-easily-send-magic-packet-wake-machine-my-subnet
(link from PowerShell - If/Else Statement Doesn't Work Properly) - Running a WOL PowerShell script through a batch file
Both throw Syntax Errors, wether I try them with cmd
or the PowerShell.
Bash one-line command to send wake on LAN magic packet without specific tool probably works in linux, but definitely not on windows
Is there a one-liner for Windows or anything that I can put in a bash batch file that actually works?
edit:
I got the second script to run (rename to .ps1, changed execution policy in PowerShell), but not to work.
Tried https://www.itnator.net/wake-lan-script-wol/ but this throws an exception:
Send-Packet : Ausnahme beim Aufrufen von "Parse" mit 1 Argument(en): "Die angegebene physikalische Adresse ist
ungültig."
In C:\wol-script.ps1:38 Zeichen:1
+ Send-Packet <mac-address>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Send-Packet
Fehler beim Durchlaufen einer Auflistung: Die Sammlung wurde geändert. Der Enumerationsvorgang kann möglicherweise
nicht ausgeführt werden..
In C:\wol-script.ps1:29 Zeichen:3
+ $Error | Write-Error;
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Collecti...numeratorSimple:ArrayListEnumeratorSimple) [], Runt
imeException
+ FullyQualifiedErrorId : BadEnumeration