Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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'm developing an application which is supposed to work in 2 modes online and offline. I need a simple and fast solution to block the internet connection for this particular application. Enabling/disabling this connection should be as fast as possible (one mouse click would be perfect) to test both modes.

This program is not installed, it's recompiled and executed every few minutes.

Can you recommend something?

share|improve this question
You could disconnect/reconnect your LAN cable.That should be faster than trying out a bunch of programs to accomplish what you're looking for... – TFM Jan 25 '13 at 22:10
up vote 0 down vote accepted

You'll have to use a firewall to achieve what you want. Windows Firewall is enough, but I'd suggest using a free software like COMODO Firewall because it's easier to configure and it always worked for me.

To block a program from accessing internet, go to Firewall settings > Define a New Blocked Application > Choose a running process or browse and select your program's executable file.

enter image description here

That's it! The application is now blocked from accessing internet. Then when you want to allow access, just go to "Network Security Policy" (it's hidden beneath the dialog) and allow it. As you need to quickly switch access, keep the "Network Security Policy" dialog open to do so.

share|improve this answer

You could block the program at the firewall, just put these in batch files (.bat), one to enable, one to disable.


netsh advfirewall firewall add rule name="ProgramTesting" dir=out action=allow program="C:\yourprogram.exe"


netsh advfirewall firewall add rule name="ProgramTesting" dir=out action=block program="C:\yourprogram.exe"
share|improve this answer
The result is "OK." but my app can still access the web :( – gisek Jan 25 '13 at 23:30

The easiest way to temporarily disable the internet is disable the DHCP Client. The easiest way to do this (on windows XP) is,

  • Right click on your My Computer Icon
  • Click Manage
  • Select Services and Applications
  • Select Services
  • Find DHCP Client

All you have to do is right click on it and hit stop. When you want to enable it again follow the same steps but this time hit start.

This is completely harmless to your computer.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .