March 2, 201016 yr I have to run a command automatically at startup. For this, I use a CMD file.The problem is the program needs internet connection. If it doesn't, then it will timeout and exit.When Windows logs on, the network connection is not available yet (DHCP).Can I do something like: loop a command to check internet connection (an address like www.google.com), and when it's available, do the rest of the commands?
March 2, 201016 yr Sure , you ping some server (you need a pingable address, some DNS aren't) and you should use an actual IP, as you may have internet connection but the DNS may not be available, depending on the result of the ping conditionally execute the command.See here:http://www.msfn.org/board/index.php?showtopic=131680http://www.msfn.org/board/index.php?showtopic=139853for some example/links.Essentially you need a single line like:@ping 74.125.53.106 -n 1 >NUL&&ECHO OK, FOUND!jaclaz
Create an account or sign in to comment