Notebook win7 Ultimate system through the batch processing ip address skills

  

1, first right click on the win7 system desktop blank space to select the first new text file, and then modify its suffix named "ldquo;.cmd" or " .bat”;
2, then copy the following code into it, then save and close the file;
Automatically get the IP address code as follows:
@echo off
echo ----From GarfieldJiang's column automatically obtains the IP address batch file---
echo -----http://hi.csdn.net/jiangzhanchang---------------- --
echo -------------------------------------------- ------------
echo is setting to get the IP address automatically, please wait ……
netsh interface ipv4 set address name=“local connection> source=dhcp< Br>: The above code sets the IP address to get automatically
netsh interface ipv4 set dns name=“local connection>source=dhcp
: The above code sets DNS to get automatically
: in the above several lines of code ;Local connection” can be modified to other as needed, such as <; wireless network connection ”
if %errorlevel%==0 (netsh interface ipv4 show ip) else (echo ---------------------An error occurred!---- -------------&echo Error code: %ERRORLEVEL%&echo Please right click and select “Run with administrator”&echo ---------- -----------------------------------------)
pause
Manual Set the IP address code as follows:
@echo off
echo ----Automatically obtain IP address batch file from GarfieldJiang column---
echo -----http://hi. Csdn.net/jiangzhanchang------------------
echo ----------------------- ---------------------------------
echo is setting the IP address manually, please wait ……
netsh interface ipv4 set address “local connection& rdquo; static 192.168.0.100 255.255.255.0 192.168.0.1
: The address above is: IP address, subnet mask, default gateway
netsh interface ipv4 Set dnsservers “local connection& quoquo; static 192.168.0.1 primary
: set the primary DNS server address in the above line
netsh interface ipv4 set dnsservers “ Ground connection & rdquo; static 192.168.0.1
: The above line sets the secondary DNS server address
: "local connection" in the above lines of code can be modified to other as needed, such as "wireless network Connection”
if %errorlevel%==0 (netsh interface ipv4 show ip) else (echo ---------------------An error occurred!--- --------------&echo Error code: %ERRORLEVEL%&echo Please right click and select “Run with administrator”&echo --------- ------------------------------------------)
pause
3, after the save is closed, then right click on the file, select “ open & rdquo; (Windows 7 needs to choose to run with the administrator).

Copyright © Windows knowledge All Rights Reserved