Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to automatically pass the firewall whenever the network connected (WIFI and LAN), I have a bat file to do this, but every time I need to run it manually, so is there a way to run this bat file whenever network available? Expect that there is a event listener for network status that I can hook to run the bat file. Or scheduled tasks can do this job?

Thanks

share|improve this question
add comment

migrated from stackoverflow.com Dec 20 '12 at 8:57

This question came from our site for professional and enthusiast programmers.

1 Answer

A simple way of doing this would be to ping the lan until it becomes available

:LOOP
ping 192.168.x.x | find "Reply" >nul
if %errorlevel%==0 start yourbatchfile && exit /b >nul
timeout /t 5
goto :LOOP
share|improve this answer
    
Thanks, that could be a solution of monitor it all the time, I'm trying to find a way of listener to solve this problem. –  JerryCai Dec 17 '12 at 5:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.