Auto Disconnect for Internet Explorer: How to Set It Up
In this article
Internet Explorer may be retired, but some older systems and business tools still rely on it. If you need to automatically disconnect from the internet after a set time—perhaps to limit data usage, enforce a break, or secure a shared computer—this guide shows you how to set that up. You'll use built-in Windows tools and a simple script, no extra software required.
What You'll Need
- A Windows PC with Internet Explorer installed (Windows 7, 8, or 10; Windows 11 does not include IE).
- Administrator access to create and run scripts.
- Basic familiarity with Notepad and the Command Prompt.
Step-by-Step
- Decide what "disconnect" means for you. Do you want to close Internet Explorer, disable the network adapter, or just disconnect from a specific Wi-Fi network? This guide covers all three, starting with the simplest.
- Option A: Close Internet Explorer automatically. The simplest way is to use Windows Task Scheduler to close IE after a time delay. Open Notepad and paste this command:
taskkill /IM iexplore.exe /F
Save the file asclose_ie.bat(make sure the extension is .bat, not .txt). - Schedule the script. Press
Win + R, typetaskschd.msc, and press Enter. In Task Scheduler, click Create Basic Task. Name it "Auto Disconnect IE". Choose Daily or One time depending on your need. For the trigger, set a specific time, or choose When the computer starts if you want it to run every time. For the action, select Start a program and browse to yourclose_ie.batfile. Finish the wizard. - Option B: Disable the network adapter after a delay. If you want to cut off all internet access (not just IE), you can disable the network adapter. Create a new batch file with this command:
netsh interface set interface "Ethernet" disabled
ReplaceEthernetwith the exact name of your network connection. To find it, open Command Prompt and typenetsh interface show interface. Note the name (e.g., "Wi-Fi" or "Local Area Connection"). Save the file asdisable_net.bat. - Schedule the network disable. Follow the same steps as in Step 3, but point the Task Scheduler action to
disable_net.bat. You may need to run the task with highest privileges (check the box in the task's properties). - Option C: Use a timed shutdown of the network via a script with a delay. If you want the disconnect to happen a certain number of minutes after IE opens, you can use a startup script. Create a batch file that starts IE and then waits, then disables the network. For example:
start iexplore.exetimeout /t 3600 /nobreaknetsh interface set interface "Wi-Fi" disabled
This waits 3600 seconds (1 hour) before disabling. Save asie_timer.batand place it in theShell:Startupfolder (pressWin + R, typeshell:startup, and paste the file there). - Test your setup. Run the batch file manually to confirm it works. If you chose to disable the network, you'll need to re-enable it manually via Control Panel > Network and Sharing Center > Change adapter settings, or by running
netsh interface set interface "Wi-Fi" enabledas administrator. - Re-enable the network after a disconnect. If you used Option B or C, create a second batch file to re-enable the network, and schedule it if needed (e.g., at a specific time the next day).
Common Mistakes
- Wrong network interface name. Using "Ethernet" when your connection is actually "Wi-Fi" causes the command to fail. Always check the exact name with
netsh interface show interface. - Forgetting to run as administrator. Disabling a network adapter requires elevated privileges. In Task Scheduler, check "Run with highest privileges" in the task's properties.
- Saving the file as .txt instead of .bat. Notepad may append .txt unless you change the "Save as type" to "All Files" and type the full filename with quotes.
- Using a relative path in Task Scheduler. Always use the full path to the batch file (e.g.,
C:\Scripts\disable_net.bat).
Tips
- Test the batch file manually before scheduling it. You can run it from Command Prompt to see any error messages.
- If you want a countdown before disconnecting, add a
timeout /t 60command at the beginning of the batch file to give you time to save your work. - Use a scheduled task instead of the Startup folder if you want more control over triggers and conditions (e.g., only on weekdays).
- For a more user-friendly approach, consider using a free tool like "Auto Disconnect" or "Net Disabler," but the built-in method is safer and has no extra software.
Troubleshooting
- The batch file does nothing when run. Check if the file extension is .bat. Also, right-click and run as administrator to see if the command works.
- Task Scheduler runs the task but nothing happens. Look at the task's "Last Run Result" code. A code like 0x2 means the file was not found. Verify the path. Also, make sure the task is enabled and the trigger is set correctly.
- Cannot re-enable the network after disabling. If you disabled the adapter, you may lose network access, but you can still use the physical switch on your laptop or go to Control Panel > Network and Sharing Center > Change adapter settings (if you have local access). If you're remote, you'll need physical access.
- Internet Explorer does not close with taskkill. If IE is running as administrator, the taskkill command may need to be run as administrator as well. Ensure the scheduled task runs with highest privileges.
- The timeout command is not recognized. The
timeoutcommand is available in Windows Vista and later. If you're on an older system, useping -n 3600 127.0.0.1 > nulto delay.
Frequently Asked Questions
Can I set a specific time to disconnect, like at 10 PM?
Yes, use Task Scheduler and set the trigger to a specific daily time. Point the action to a batch file that disables the network or closes IE.
Will this work on Windows 11?
Internet Explorer is not available on Windows 11, so this guide applies to Windows 7, 8, and 10. The network disable commands still work on Windows 11, but you would use a different browser.
How do I undo the auto disconnect?
Simply delete the scheduled task or remove the batch file from the Startup folder. To re-enable the network manually, use the command netsh interface set interface "Wi-Fi" enabled as administrator.
Can I make it disconnect only when IE is idle, not after a fixed time?
That would require a more complex script that monitors IE's activity. The built-in tools don't offer idle detection, but you could use a PowerShell script with timers. This guide focuses on fixed time delays.
Is there a way to disconnect after a certain amount of data usage?
Windows does not have a built-in data cap feature. You would need third-party software or a router with data limits. This guide only covers time-based disconnects.
Will disabling the network adapter affect other users on the same computer?
Yes, disabling the adapter cuts off all internet access for every user on that PC. If you need per-user control, consider using Windows parental controls or a guest account with different settings.