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 need to test how an application that uses an Internet connection to work behaves when there is no Internet. I disable/enable my network connection each time to test. Is there a way to do this in a single click using software?

share|improve this question
    
... What's wrong with pulling the plug? –  Ignacio Vazquez-Abrams Jun 29 '10 at 5:48
    
I am looking for something easier. The plug is behind the desk and is hard to reach. –  Gerhard Jun 29 '10 at 5:51
1  
So then get a coupler, or a switch you can put on the desk. –  Ignacio Vazquez-Abrams Jun 29 '10 at 5:57
add comment

3 Answers

up vote 2 down vote accepted

Create a batch file with the code

ipconfig /release
pause > nul
ipconfig /renew

just run the batch file to disconnect then press any key to restore network connectivity.

share|improve this answer
    
Exactly what I need! –  Gerhard Jun 29 '10 at 7:57
    
I would put an "echo Press any key to enable network..." before the pause, just in case you forget what the window is for (maybe you take a break or something)... –  Hello71 Jun 29 '10 at 23:59
    
I created two batch files NetOff.bat and NetOn.bat –  Gerhard Jun 30 '10 at 5:24
    
If they're short @Gerhard: paste them in your answer and I will add them to @john's answer. Great to hear his solution worked! –  Ivo Flipse Jun 30 '10 at 6:32
    
netoff.bat contains ipconfig /release and neton.bat contains ipconfig /renew These commands can also be used with AutoHotkey. –  Gerhard Aug 3 '10 at 10:59
add comment

You could download some macro recorder, and record a macro for both enabling and disabling the network adapter(s).

share|improve this answer
add comment

You can use Net Profiles to disable/enable your internet connection. Create a profile for your current settings by which internet is enabled. Create another profile with a false proxy server by which internet is disabled. Then you can switch between these profiles to enable/disable the internet connection.

share|improve this answer
add comment

Your Answer

 
discard

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.