In Windows, use a script to quickly modify the IP Address [plain] @ echo off: main cls color 02 echo. --------------------------------------------- echo. welcome to the IP address switching script echo created by PrudentWoo. script-based echo switching for Windows platforms. http://www.prudentwoo.com PrudentWoo? Echo. -------------------------------------- echo. 1. wlan (preset IP Address Setting for wireless network adapter) echo. 2. ethernet (preset IP Address Setting of the Ethernet NIC) echo. 3. custom IP address echo. 4. clear DNS Cache echo. 5. enable or disable Wi-Fi hotspot echo. 6. IP address information echo. 7. exit echo. -------------------------------------- set/p choice = enter the execution project serial number: echo. if % choice % = 1 goto Wlan if % choice % = 2 goto Ethernet if % choice % = 3 goto IP-Selfset if % choice % = 4 goto Clear DNS if % choice % = 5 goto WIFI if % choice % = 6 goto IP_Info if % choice % = 7 cls goto end @ rem below is the batch processing of Preset IP Address Settings for wireless network adapter: Wlan cls color 03 echo. you are setting the Wi-Fi IP address! Echo. ------------------------------ echo 1. set to wi-fi DHCP echo 2. set Wi-Fi static public IP echo 3. return echo. --------------------------- set/p choice = select the execution project serial number: if % choice % = 1 goto 1 if % choice % = 2 goto 2 if % choice % = 3 goto 3: 1 echo. configuring DHCP. Please wait... echo. the IP address is automatically obtained from DHCP... netsh interface ip set address "Wi-Fi" dhcp echo. the DNS address is automatically obtained from DHCP... netsh interface ip set dns "Ethernet" dhcp echo. all settings are complete! --- @ Pause goto end: 2 echo. setting the Wi-Fi public IP address. Please wait... echo. IP address = 192.168.1.123 echo. subnet Mask = 255.255.255.0 echo. default Gateway = 192.168.1.1 echo. preferred DNS = 10.252.8.5 echo. alternative DNS = 10.252.8.4 net interface ip set address name = "Wi-Fi" source = static addr = 192.168.1.123 mask = 255.255.255.0> null net interface ip set address name = "Wi-Fi" gateway = 192.168.1.1 gwmetric = 1> null net interface ip set dns name = "Wi-Fi" source = static addr = 10.252.8.5 net interface ip add dns name = "Wi-Fi" 10.252.8.4 index = 2 echo all settings are complete! Press any key to exit echo... @ Pause goto end: 3 Goto main @ rem The following is the batch processing of Preset IP address settings for the Ethernet NIC: Ethernet cls color 2f echo. you are setting the Ethernet IP address! Echo. ----------------------------------- echo 1. set Ethernet to DHCP echo 2. set Ethernet static public network IP1 (office network) echo 3. set Ethernet static public network IP2 (dormitory Network) echo 4. return echo. ----------------------------------- set/p choice = select the execution project serial number: if % choice % = 1 goto 1 if % choice % = 2 goto 2 if % choice % = 3 goto 3 if % choice % = 4 goto 4: 1 cls color 26 echo. configuring DHCP. Please wait... echo. the IP address is automatically obtained from DHCP... netsh interface ip set address name = "Ethernet Network "source = dhcp echo. The DNS address is automatically obtained from DHCP... netsh interface ip set dns" Ethernet "source = dhcp echo. All settings are complete! @ Pause goto enthernet: 2 cls color 35 echo is configuring Ethernet public network static IP1 (office network). Please wait... echo. echo. set the parameter to echo. --------------------------- echo. IP address = 198.9.2.123 echo. subnet Mask = 255.255.255.0 echo. default Gateway = 198.9.2.1 echo. preferred DNS = 202.112.20.131 echo. --------------------------- echo. setting the above IP Parameters... ipconfig/release netsh interface ip add address name = "Ethernet" addr = 198.9.2.123 mask = 255.255.255.0 gateway = 198.9.2.1 netsh interfa Ce ip add address name = "Ethernet" addr = 10.2.2.234 mask = 255.255.255.0 gateway = 10.2.2.254 netsh interface ip add address name = "Ethernet" addr = 10.0.0.10 mask = 255.0.0.0 netsh interface ip add address name = "Ethernet" addr = 192.168.133.20 mask = 255.255.255.0 netsh interface ip add address name = "Ethernet" addr = 192.168.54.345 mask = 255.255.255.0 netsh interface ip add address name = "Ethernet" addr = 192.168.7.1 mask = 255.255.255.0 netsh Interface ip add dns name = "Ethernet" addr = 202.106.0.20 netsh interface ip add dns name = "Ethernet" addr = 211.147.6.3 netsh interface ip add dns name = "Ethernet" addr = 202.106.0.21 netsh interface ip add dns name = "Ethernet" addr = 202.105.12.226 netsh interface ip add dns name = "Ethernet" addr = 61.144.56.100 netsh interface ip add dns name = "Ethernet" addr = 202.96.128.68 netsh interface ip add dns name = "Ethernet" ad Dr = 202.96.128.86 echo. All settings are complete! @ Pause goto ethernet: 3 echo: Configuring static IP2 for Ethernet public network (dormitory network). Please wait... echo. echo. set the parameter to echo. --------------------------- echo. IP address = 192.168.1.33 echo. subnet Mask = 255.255.255.0 echo. default Gateway = 192.168.1.33 echo. preferred DNS = 61.144.56.100 echo. --------------------------- ipconfig/release netsh interface ip add address name = "Ethernet" addr = 192.168.1.33 mask = 255.255.255.0 gateway = 192.168.1.1 netsh interface ip add dns name = "Ethernet" Addr = 202.106.0.20 netsh interface ip add dns name = "Ethernet" addr = 211.147.6.3 netsh interface ip add dns name = "Ethernet" addr = 202.106.0.21 netsh interface ip add dns name = "Ethernet" addr = 202.105.12.226 netsh interface ip add dns name = "Ethernet" addr = 61.144.56.100 netsh interface ip add dns name = "Ethernet" addr = 202.96.128.68 netsh interface ip add dns name = "Ethernet" addr = "202.96.128.86 echo. all settings are complete! @ Pause goto enthernet: 4 goto main @ rem the following is an ip address custom batch processing: ip-selfset cls echo. You are performing the Ethernet ip address custom setting operation!: Ip1 cls color 13 echo. IP custom settings start .... echo. echo starts to set IP address and subnet mask set/p saddr = enter static address: if/I "% saddr %" = "" goto ip1 set/p mask = enter the subnet mask: if/I "% mask %" = "" goto ip1 set/p gateway = enter the Default gateway: if/I "% gateway %" = "" goto ip1 goto IP_judge: IP_judge cls echo. the IP address parameters you entered are as follows: echo. -------------------- echo. IP Address: % saddr % echo. subnet mask: % mask % echo. default gateway: % gateway % echo. -------------------- echo. echo. if the preceding parameters are correct, Press Y to continue. If the preceding parameters are incorrect, Press Y. N returns resetting! Echo. set/p choice = your choice: if "% choice %" = "N" goto ip1 if "% choice %" = "n" goto ip1 if "% choice %" = "Y" goto ipaddr if "% choice %" = "y" goto ipaddr goto IP_judge echo.: ipaddr cmd/c netsh interface ip set address name = "Local Area connection" source = static addr = % saddr % mask = % mask % gateway = % gateway % gwmetric = 1> nul goto ipdns: ipdns cls echo start to set DNS server set/p dnsaddr = enter DNS server: if/I "% dnsaddr %" = "" g Oto: ipdns @ rem the following statement sets DNS cmd/c netsh interface ip set dns name = "Local Area connection" source = static addr = % dnsaddr % register = PRIMARY> nul echo. set DNS backup server set/p dnsaddr2 = enter the backup DNS server: if/I "% dnsaddr2 %" = "" goto: ipdns goto DNS_judge: DNS_judge cls echo. echo. -------------------------- echo. echo. DNS preferred server: % dnsaddr % echo. echo. DNS Backup Server: % dnsaddr2 % echo. echo. -------------------------- echo. above D If the NS parameter is correct, Press Y to continue. Otherwise, press N to return and reset! Echo. set/p choice = your choice: if "% choice %" = "N" goto ipdns if "% choice %" = "n" goto ipdns if "% choice %" = "Y" goto ipdns2 if "% choice %" = "y" goto ipdns2 goto DNS_judge: ipdns2 cmd/c netsh interface ip add dns name = "Local Area Connection" addr = % dnsaddr2 % index = 2> nul echo. @ pause goto main if errorlevel 2 goto main if errorlevel 1 goto end: Clear DNS cls cmd/c ipconfig/flushdns echo. DNS cache cleared! @ Pause goto main: WIFI cls echo. You are setting a Wi-Fi hotspot! Echo. ----------------------------------- echo 1. enable WIFI Hoc echo 2. disable WIFI Hoc echo. --------------------------------- set/p choice = enter your selection number: if "% choice %" = "1" goto start if "% choice %" = "2" goto stop: start cmd/c netsh wlan start hostednetwork @ Pause goto main: stop @ Pause goto main cmd/c netsh wlan stop hostednetwork: IP_Info cls color 5f echo. the following is your IP address information: cmd/c ipconfig/all @ pause goto main