1 @ echo off 2 CLS 3 :: set Name = "Local Connection" 4 set name = "wireless network connection" 5 set IP = 192.168.1.55 6 set mask = 255.255.255.0 7 set gateway = 192.168.1.1 8 set dns1 = 42.120.21.30 9 set dns2 = 114.114.114.11410 11 echo.12 echo automatically obtains the IP address. Press 113 echo.14 echo to manually set the IP address. Press 215 16 set/p key = [your choice is:] 17 if % key % = 1 goto one18 if % key % = 2 goto two 19 20: two21 echo you have selected to manually set the IP address. 22 echo. 23 netsh interface IP Set address name = % name % static % IP % mask % gateway % 24 netsh interface IP Set DNS % name % dns1 % Index = 125 netsh interface IP Set DNS % name % dns1 % Index = 226 The echo IP address has been set and modified, press any key to close this window 27 pause28 exit29 30: one31 echo. You have chosen to automatically obtain the IP address. 32 echo. 33 netsh interface IP Set address name = % name % dhcp34 netsh interface IP Set DNS % name % dhcp35 36: netsh interface IP add DNS % name % dns1 % Index = 137 :: netsh interface IP add DNS % name % dns1 % Index = 238 39 echo IP address has been set and modified. Press any key to close this window 40 pause41 exit
Script for setting IP addresses quickly