downloads network scripting windows windows 7 windows xp

Windows Network Card Configuration Script

As part of my job, I work in the field on various different sites configuring routers, testing network etc. This can be a tedious task especially when I need to constant change my network adapter settings, like IP Addresses and Gateway settings.

I have developed a simple script that allows me to quickly change between Dynamic IPs and Static IPs. If using Static, I am able to enter the values I need to complete my work.

While it isn’t hard to change an IP Address in Windows 7, I find it requires more clicks than Windows XP and that is why I developed this script.

You can download the script from the link below and modify as needed. You will need to modify it to identify with the label of your intending Network Adapter. In my case, my Network Adapter is labelled “Local Area Connection”, however yours may differ.

If you find this script helpful, please let us know in the comments below.

See the file here: https://1drv.ms/u/s!Ao_CwzvHd4nujt14UAFLVr6N4PsP1g


#
# Simple Network Configuration Script
# By Daniel Burrowes - 2011
# Based on script created by Scott D. (http://community.spiceworks.com/how_to/show/320)
#

@echo off
cls
color 74
echo =================================================================
echo   Simple Network Configuration Script
echo =================================================================
echo   Your current interface configuration "Local Area Connection"
netsh int ip show config "Local Area Connection"
echo =================================================================
echo:
echo Please choose from the following:
echo:
echo [1] Set Static IP 
echo [2] Set DHCP 
echo:
echo =================================================================

:choice 

SET /P C=[1,2]? 
for %%? in (1) do if /I "%C%"=="%%?" goto 1 
for %%? in (2) do if /I "%C%"=="%%?" goto 2 
goto choice 


:1 

@echo off 
echo "Please enter Static IP Address Information" 
echo:
echo Enter IPv4 Address: 
set /p IP_Addr=
echo:
echo Enter Default Gateway Address:
set /p D_Gate=
echo:
echo Enter Subnet Mask Address:
set /p Sub_Mask=
echo:
echo Enter Primary DNS Server Address:
set /p PDNS=
echo:
echo Setting Static IP Information... 
netsh int ipv4 set address "Local Area Connection" static %IP_Addr% %Sub_Mask% %D_Gate% 1
netsh int ipv4 set dnsservers "Local Area Connection" static %PDNS% primary no
echo Done!
echo:
echo New IPv4 settings for %computername% - "Local Area Connection":
netsh int ipv4 show config "Local Area Connection".
echo Done!
echo:
pause 
goto end

:2

@ECHO OFF 

echo:
ECHO Resetting IP Address and Subnet Mask For DHCP... 
netsh int ipv4 set address "Local Area Connection" dhcp
echo Done!

echo:

echo Resetting DNS Servers for DHCP...

netsh int ipv4 set dnsservers "Local Area Connection" dhcp

echo Done!

echo:

echo Renewing IP Addresses...
ipconfig /renew | find ""

echo Done!

echo:

echo New IPv4 settings for %computername% - "Local Area Connection": 

netsh int ipv4 show config "Local Area Connection"
echo Done!

echo:

pause 

goto end 

:end

cls

color

Leave a Reply

Discover more from Daniel Bs Tech Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading