Batch Wake-On-Lan

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Batch Wake-On-Lan

#16 Post by penpen » 25 Dec 2013 06:53

thephantomblu wrote:So I think there is absolutely NO way to do this in native batch.
It is sure possible to do it using pure batch, assuming that all is counted to "native batch" which is listed here:
http://technet.microsoft.com/en-us/library/bb490890.aspx
But it is also toooo much work, to do it this way:
You may register the device ("network card"->"protocol UDP" -> ...) to the a Win32 File Namespaces (using the name WOL),
which surely can be done using vbscript/jscript (load the right system dlls/functions);
but who knows the name of these, and the devices and their names are probably system dependent ... .
Then you have to (somehow) create all needed hexadecimal values;
for example create a file per hexadecimal value 0x00 to 0xFF (with for example jscript) and name it "0x00.dat", "0x01.dat", ... "0xFF.dat".
Then you have to build the magic packet, for example this way

Code: Select all

copy "0xFF.dat" /B + "0xFF.dat" /B ... "clientX.magic.packet" /B
Finally you have to send the magic packet to the WOL device:

Code: Select all

copy /B "clientX.magic.packet" WOL

But such a solution is highly system dependent;
it costs time to find the needed parts;
you surely need admin rights to do this;
any windows update that moves a needed function from one dll to another will cause the solution to not work anymore;
and possibly there are additional disadvantages (security issues, as the data won't pass any security manager, ...);
so i think the .NET/Powershell solution is preferable to do this.

penpen

Post Reply