Hey, I'm a complete noob to batch commands. I just found that they might be somewhat useful for some stuff I'm doing, so I thought I'd try them out.
Anyway, I've got a batch file that calls a program called Poweroff to turn on a pc on my network via WOL (wake on lan).
Here is the code:
CLS @ECHO ON poweroff wol -ip 192.168.0.3 -subnet 255.255.255.0 -mac 0xxxx00xxxxx call wait 90 CLS EXIT
As you can see, I'm calling a script called wait.bat, that simply pauses the script for 90 seconds to make sure the box has come out of hibernate before I continue processing commands. But I would like it to be more efficient. Rather than just waiting 90 seconds, and then continuing on, I would like to ping 192.168.0.3, and wait till there is a reply, and then go on. That way I can make sure the box is up before continuing.
Anyone know how to check the ping reply to make sure it is getting a reply before continuing on?
edit: I replaced the MAC address for security purposes.