简体   繁体   English

一键从窗口发送魔术包

[英]send magic packet from windows with one click

WOL works perfectly well via the Router, but that requires logging in to the control and browse trought the menus. WOL 通过路由器完美运行,但这需要登录到控件并通过菜单浏览。 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.两者都会抛出语法错误,无论我是用cmd还是 PowerShell 尝试它们。

Bash one-line command to send wake on LAN magic packet without specific tool probably works in linux, but definitely not on windows Bash 单行命令在没有特定工具的情况下在 LAN 魔术包上发送唤醒可能适用于 linux,但绝对不适用于 Windows

Is there a one-liner for Windows or anything that I can put in a bash batch file that actually works?是否有适用于 Windows 的单行程序或任何可以放入实际工作的bash批处理文件的内容?


edit:编辑:

I got the second script to run (rename to .ps1, changed execution policy in PowerShell), but not to work.我运行了第二个脚本(重命名为 .ps1,在 PowerShell 中更改了执行策略),但不起作用。

Tried https://www.itnator.net/wake-lan-script-wol/ but this throws an exception:试过https://www.itnator.net/wake-lan-script-wol/但这会引发异常:

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

https://www.gammadyne.com/cmdline.htm#wol works, and it´s "only" 193K (go-wol is around 5MB). https://www.gammadyne.com/cmdline.htm#wol有效,它“仅”193K(go-wol 大约 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.路由器设置的深层链接会更小,但我猜 AVM 软件不允许这样做。

Only wish remaining is to hibernate the machine via Magic Packet, but my NIC is probably too old for that.剩下的唯一希望是通过 Magic Packet 使机器休眠,但我的 NIC 可能太旧了。 I think I will use PuTTY for that.我想我会为此使用PuTTY

Thanks everyone for digging!谢谢大家挖掘!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM