Irfan Nasim
Irfan Nasim

Reputation: 2232

Create a Batch File to Easily Refresh Network Settings?

Create a Batch File to Easily Refresh Network Settings?

I facing the problem with network which frequently disconnection, due to this i used to renew my ip address and network setting to get new network setting from other ISP which i have switched.

i need batch file to create ipconfig/release and ipconfig/release command running on the same time and network setting refreshed.

Upvotes: 2

Views: 39204

Answers (2)

Vicky Dev
Vicky Dev

Reputation: 2173

Care for a better script anyone ? Put below lines in a text file and save it as .bat/.cmd file(eg. ResetNetwork.bat) and run it:

ipconfig /release
ipconfig /renew
arp -d *
nbtstat -R
nbtstat -RR
ipconfig /flushdns
ipconfig /registerdns
  • The two ipconfig commands will release the current IP address and then immediately ask for a new one.
  • The arp command deletes the current hostname so we can reacquire it.
  • The nbtstat -R command purges and reloads the remote cache name table.
  • The nbtstat -RR command sends Name Release packets to WINS and then starts a refresh.
  • The final two ipconfig commands flush the DNS and then initiate manual dynamic registration for the DNS names and IP addresses that are configured at the computer.

Upvotes: 0

T.Malik
T.Malik

Reputation: 107

you need to take care of some thing to create batch file. follow the following steps.

Lets get started.

Step 1: Click on the “Start” menu and go to “All Programs”. Go to “Accessories” and open “Notepad”.

Step 2: In Notepad, type in the following commands which will be run to refresh a computer’s network settings.

ipconfig /release

ipconfig /flushdns

ipconfig /renew

The “release” switch will release your current IP address settings. The “flushdns” switch will flush the DNS resolver cache. The “renew” switch will renew your IP address settings.

Step 3: Now click on the “File” menu and select “Save As”. Change the “Save As Type” field to “All Files” located near the bottom of the window. Now enter a “File Name” such as “Refresh.bat” without the quotes. It is important that you put the .bat extension on the end of the file name or you will not be able to execute it as a batch file. Choose a “Save In” location and click the “Save” button to save it.

Step 4: Now you can run your new batch file by double clicking on it.

After the batch file has finished executing, the computer’s network settings will be refreshed.

Upvotes: 2

Related Questions