RSS Forums RSS
Please support our Legacy and Other Languages advertiser: Programming Forums

DOS Batch command to ping network IP

Join Date: May 2005
Posts: 229
Reputation: nathanpacker is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

DOS Batch command to ping network IP

  #1  
Mar 27th, 2007
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?
Thanks.

edit: I replaced the MAC address for security purposes.
Last edited by nathanpacker : Mar 27th, 2007 at 8:31 pm.
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:27 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC