发布网友 发布时间:2022-04-23 08:40
共1个回答
热心网友 时间:2023-10-08 21:35
以下是我常用的,你可以参考下:
----------------------------------------配置为DHCP获得地址----------------------------------------
cd\
cls
netsh interface ip set address "本地连接" source=dhcp
netsh interface ip set DNS "本地连接" source=dhcp
------------------------------------------------------------------------------------------------------------
---------------------------------------配置静态IP地址--------------------------------------------------
cd\
cls
netsh interface ip set address "本地连接" source = static addr =192.168.1.254 mask=255.255.255.0
netsh interface ip set address "本地连接" gateway = 192.168.1.100 gwmetric =1
netsh interface ip set DNS "本地连接" static 202.106.0.20
------------------------------------------------------------------------------------------------------------追问@echo off
title 数字转换IP
color 2
:S
set /p i=Number:
set /a a=%i%/(256*256*256)
set /a b=%i%%%(256*256*256)/(256*256)
set /a c=%i%%%(256*256*256)%%(256*256)/256
set /a d=%i%%%(256*256*256)%%(256*256)%%256
echo IP Address: %a%.%b%.%c%.%d%
pause>nul
goto S