Windows System IP flexible setting script

2011-06-15  来源:本站原创  分类:Development  人气:54 

Recently using the DOS command to write a script to set IP and flexible, so you can set different IP network environment.

@echo off
set /P var=" Please select your location :[1] Fixed IP,[2] Automatic acquisition of ,[3] Cancel :"
echo.
echo.
echo  Setting up IP. gateway .DNS...
echo.
if %var%==1 goto config
if %var%==2 goto net2
if %var%==3 goto end 

:config
set /P IP=" Set a fixed IP address :"
set /P Gateway=" Set gateway :"
#set /P DNS1=" Set your preferences DNS:"
#set /P DNS2=" Set the standby DNS:"
goto net1

:net1
echo   *****************************************************
echo                    IP Address   :%IP%
echo                     Subnet mask :255.255.255.0
echo                     Gateway     :%Gateway%
echo   *****************************************************
netsh interface ip set address name="Local Area Connection" source=static addr=%IP% mask=255.255.255.0 >nul
netsh interface ip set address name="Local Area Connection" gateway=%Gateway% gwmetric=0 >nul
#netsh interface ip set dns name="Local Area Connection" source=static addr=%DNS1% register=PRIMARY >nul
#netsh interface ip add dns name="Local Area Connection" addr=%DNS2% >nul
goto end
:net2
netsh interface ip set address name="Local Area Connection" source=dhcp >nul
# netsh interface ip set dns name="Local Area Connection" source=dhcp >nul
goto end
:end
echo  Set .
echo.
exit
相关文章
  • Windows System IP flexible setting script 2011-06-15

    Recently using the DOS command to write a script to set IP and flexible, so you can set different IP network environment. @echo off set /P var=" Please select your location :[1] Fixed IP,[2] Automatic acquisition of ,[3] Cancel :" echo. echo. ec

  • WINDOWS system set up under the dual card route this paper relates to the static routing 2010-06-17

    WINDOWS system set up under the dual card route this mainly related to static routing. 2, WINDOWS systems set up routing Manually set the route under the WINDOWS main character in the DOS command under the system (in the run input box you can type th

  • Daquan Windows system running the command 2010-09-29

    Collection of Windows system running the command Collection give it all, hoping to help you. explorer ------- Open the Explorer Nslookup ------- IP address detector logoff --------- cancellation of orders tsshutdn ------- 60 second countdown shutdown

  • Detailed description of the Windows system port control 2011-01-21

    Windows System port control are detailed below. Port: 0 Services: Reserved Note: usually used to analyze the operating system. This approach can work because in some systems, "0" is invalid port, when you try to use it normally closed port will

  • windows system optimization and speed 2011-03-21

    <! - Google_ad_client = "pub-2416224910262877"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_channel = ""; google_color_border = "E1771E"; google_color_bg = "FFFFFF

  • Java implementation Windows system services (transfer) 2008-07-15

    How to turn a Java program made NT Service article: From: http://blog.csdn.net/ishallwin/archive/2010/03/04/5347171.aspx Windows System Service (NT service) relative to the general application, the most direct one advantage is that the system startup

  • Java implementation Windows system service (change) 2010-03-30

    Windows System Service (NT service) relative to the most common application of a direct advantage of the system startup can be run directly without user login system. In fact, to use the system as a server, usually do not need to log in, so not only

  • windows system environment variable configuration under JDK1.6 2010-04-08

    windows system environment variable configuration under JDK1.6 1, JDK1.6 download Currently the latest version of JDK is JDK1.6, to http://java.sun.com/javase/downloads/index.jsp can download JDK1.6. Second, JDK1.6 installation JDK installation is ve

  • windows system comes with the most humble but most powerful anti-virus tools 2010-04-09

    windows system comes with the most humble but most powerful anti-virus tools. Windows systems integrate numerous tools that carry out their duties, to meet different user applications. In fact, these tools "versatile", if you have enough imagina

  • Derived using the windows system logs regularly dumpel 2010-12-02

    1, windows system log storage: windows system logs stored in the C: \ WINDOWS \ system32 \ config directory, the file suffix evt. 2, Export Tool: Dumpel.exe windows can be exported using the system log. dumpel.exe can go to Microsoft's official websi

  • the process windows system monitoring program - to achieve process record 2011-05-26

    Unit has a call center server interface program, which emerged three days automatically withdraw from the case, this interface program is to manage incoming calls assigned to the customer service staff on duty there, the interface program was develop

  • Periodically export using the windows system log dumpel 2010-12-02

    1, windows system log storage: the windows system logs are stored in C: \ WINDOWS \ system32 \ config directory, the file suffix evt. 2, Export Tool: Use dumpel.exe can export the windows system log. dumpel.exe can go to Microsoft's official website

  • windows system environment variable configuration JDK1.6 2010-04-08

    windows system environment variable configuration JDK1.6 A, JDK1.6 download Currently the latest version of JDK is JDK1.6, to http://java.sun.com/javase/downloads/index.jsp can download JDK1.6. Two, JDK1.6 installation JDK installation is very simple

  • windows system hosts file to modify the invalid software solution 2011-03-15

    windows system hosts file to modify the invalid software solution 1, hosts file path: C: \ windows \ system32 \ drivers \ etc \ hosts; 2, hosts file to code to: ansi; 3, add the record content: ip + space + domain name (eg: 127.0.0.1 www.abc.com) pin

  • windows system know DB2 port number of the "coup" 2011-01-21

    Mainly to tell you today is that in aix, linux, windows system to know DB2 port number of the actual operation of the program, I believe that if you master in aix, linux, windows system know DB2 port number of the actual operation of the technology p

  • Under the Windows system integrates the latest version of Apache2, Perl5, PHP5, MySQL5, phpMyAdmin 2008-08-10

    1, in the Windows system under the integration of the latest version of Apache2, Perl5, PHP5, MySQL5, phpMyAdmin, does not require additional installation, you can use this after decompression integrate systems. Operating System: Windows Software Hom

  • Windows system log, the desktop display slow solution 2010-03-06

    Windows system startup and login, the desktop loads slow symptoms: Start normal, scroll bars and the login screen (loading personal settings) where the waiting time is not long, but into the system, desktop background and desktop icons and task colum

  • During restart, replace the windows system file protection 2010-03-17

    During restart, replace the windows system file protection Study: ClassyK date :2006-01-25 This is the first to write a 3721 Origin uninstall software, when the system files are deleted, but the search will still be targeted to 3721, for example, whe

  • In the Windows system directory to mount UNIX NFS share 2010-02-16

    Taken from: http://cha.homeip.net/blog/archives/2005/11/_windows_unix_n.html This is a very interesting tool, Microsoft do have access to Linux NFS tools, many functions. Microsoft's site said: https: / / www.microsoft.com/taiwan/windows/sfu/ Windows

  • Windows system programming of asynchronous I / O and complete the port 2010-04-08

    1, synchronous I / O and asynchronous I / O In introducing this part before you come to know under the "asynchronous I / O". Speaking of asynchronous IO, is easy to think of synchronous I / O, for the same I / O object handle at the same time al