I have an app that needs to start after the LAN network is available when windows starts. Is there anyway to determine when the network is ready to go after windows has been started?
Do a ping to a known adress in your network (the router f.i.)
If you want to do this outside your program do a ping to a file : ping 192.182.1.1 > c:\ping.txt and then search with grep for the text :
grep "Time-out" c:\ping.txt
if errorlevel 1 goto error
start here the application
:error
that may be fine if you are checking for a tcp/ip
connection. you could also us the clientsocket object
to check the connection. If you are accessing windows
networking I would guess you would have to use a netbeui
type connection. This I havent a clue. But I would imagine you would just attempt to connect with a socket or whatever and test return values. If you are using a socket you will be connecting to a server and if the server is not available you know the network connection is not up. You should have some error checking whenever you access the server anyway, just extend this to your situation.
In a nutshell, Just connect, if you cant, you cant.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.