-1

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

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
Titus
  • 452
  • 8
  • 19
  • You can use go-wol. It is cross platform. You can also set aliases to your mac addresses. https://github.com/sabhiram/go-wol/releases – sigkilled Sep 21 '21 at 09:13
  • @sigkilled downloaded that and tried - with no effect. Made eth0 on the other machine to listen for broadcasts; no effect. No errors though; That´s progress. Does it make a difference that I have an Intel CPU instead of an AMD? – Titus Sep 21 '21 at 09:23
  • it should not make any difference if I'm not mistaken. Because it is an ethernet standard. Do you have multiple ethernet adapters on the machine which you are using to send magic packet? – sigkilled Sep 21 '21 at 09:42
  • @sigkilled only eth0; everything else is disabled. It claims the packet was sent successfully. – Titus Sep 21 '21 at 13:28
  • is there any router between two computers? I am not sure that the magic packet has been received by computer although you received success message – sigkilled Sep 21 '21 at 19:21
  • @sigkilled I found a software that works; so I am pretty sure that the packet goes through. ;) Thanks for your input, though. I am unsure wether the Router is physically between the computers, but it probably is logically. – Titus Sep 22 '21 at 12:16

1 Answers1

1

https://www.gammadyne.com/cmdline.htm#wol works, and it´s "only" 193K (go-wol is around 5MB).
I will put a batch script around it and then I´m done.
A deep link into the router setup would be smaller, but I guess that the AVM software does not allow that.

Only wish remaining is to hibernate the machine via Magic Packet, but my NIC is probably too old for that. I think I will use PuTTY for that.

Thanks everyone for digging!

Titus
  • 452
  • 8
  • 19