Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using a p2p program that runs as a service. But that program has a bug that it will not be able to work properly if the computer is not connected to internet, at the time the service is starting.

And this happens all the time, because i am in a wireless network and its getting connected after i login.

So, i want to check if my computer is connected to the internet before starting the p2p service. And i want it to be programmatic (at the startup time)because, its happens in all the windows 7 machines.

Even though i addresses only one problem, i also have to know is my computer is connected with any wireless network programmattically.

Are both the things are possible!! I am relatively new to sys admin tasks like this.

Any suggestions would be appreciative.


share|improve this question

Does this bug cause the program to stop completely or hang? If it stops, you could simply use the service properties to restart the service automatically (Services -> Properties -> Recovery tab).

Alternatively you could use a Scheduled Task that runs a batch script to check the service status and start it if necessary.

It gets more complicated if the program hangs without the process closing.

share|improve this answer
The service starts and running fine. But due to the bug in that program, it was not able to heal itself when the computer is connected to a network( to internet). – xyz Nov 22 '11 at 19:40
If you show me how, i would like to go with the batch script option. – xyz Nov 22 '11 at 19:42
You didn't actually answer my question. Does the service stop or not? The batch script won't work either if you aren't able to detect that the service is not working, but still running. – RichardM Nov 24 '11 at 14:50

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.