How to reset network connection in Windows 10 with batch file

0

Network connections from older or reused PCs may stop working for no apparent reason. Users can overcome this frustrating situation by running a simple batch file.

Image: iStock / Voren1

In the relentless battle to stay ahead of malicious criminals, Microsoft and other vendors are constantly updating, fixing, and refining network security protocols. For the most part, modern network interface connectors, the hardware responsible for establishing and maintaining your network connection, can handle these changes through software updates.

However, old network cards (usually Wi-Fi) from older or reused PCs and laptops may stop working for no apparent reason at the most inconvenient time. Whether at an alternative school or an important team meeting, an Internet network connection is the first prerequisite. If you have a problematic network connection that tends to fail periodically, you can create a simple batch file to reset the connection on the fly in seconds.

This tutorial explains how to create a batch file in Windows 10 that will reset a network connection.

SEE: Research: How to Successfully Address the Technical and Management Challenges of a Remote Workforce (TechRepublic Premium)

How to reset network connection in Windows 10 with batch file

First of all, a word of advice. If you have a network card that crashes periodically, for some reason, you should consider purchasing a replacement card. USB network interfaces are available for around $ 25. It’s a small price to pay for relief from what can be a frustrating experience.

However, instead of this solution, you can create a simple batch file that turns off the network connection and then immediately turns the connection back on. This process forces the network card to “reboot” and reset the network connection. If the described process fails to reset the connection, you may experience other issues and further troubleshooting will be required.

Before we start the batch file, we need to put together some vital information first. Open a command prompt by using the Windows + R key combination and typing “cmd” in the text box, as shown in Figure A.

Figure A

un-reset-nic-batch-file.jpg

Type this command in the command prompt and press Enter.

netsh interface display interface

The system will show you a list of network connections installed for your computer, like the one shown in Number B. Write down the network connection name of the network adapter you are having trouble with, and then close the Command Prompt window.

Number B

b-reset-nic-batch-file.jpg

Now create the batch file. Start your favorite text editor, which for Windows 10 users is usually Notepad. Type “notepad” in the search box and select the app from the results.

Type the following commands in your text file:

@ ECHO OFF

cls

netsh interface set interface PROBLEM disable

netsh interface set interface PROBLEM enable

pause

Your text file should look something like Figure C. NOTE: Replace “PROBLEM” with the name of your connection problem (Wi-Fi, Ethernet 2, etc.).

Figure C

c-reset-nic-batch-file.jpg

In Notepad, click File | Save As, select All File Types, choose the Desktop folder as the location, and give the file a descriptive name. Remember to use the “.bat” file type. For our example, we named the file ResetNIC.bat.

Exit Notepad when you have saved your batch file.

You will need to run the batch file with the administrative credentials each time. So instead of left clicking on the batch file, right click on it and select Run as administrator from the context menu.

With echo off, you won’t see much happening, but your network connection issue will have been disabled and then enabled sequentially, resetting the connection.

As mentioned earlier, if this doesn’t reestablish a network connection, you may have other network issues to resolve. Your connection issues may be related to your router or ISP. These issues require a different set of commands and a different batch file, which we’ll explore in a separate article.

Also look

Share.

Comments are closed.