复制代码 代码如下:
@Echo Off
TITLE ip设置器
:start
CLS
COLOR 2f
:: 使用COLOR命令对控制台输出颜色进行更改
mode con cols=56 lines=20
:: MODE语句为设定窗体的宽和高
:sc_main
echo -------------------------------------------
echo.&echo.
echo 0.192.168.0.99 & echo.
echo 1.192.168.1.99 & echo.
echo q.退出 & echo.&echo.&echo.&echo.&echo.&echo.
set "select="
set/p select= 输入数字,按回车继续 :
if "%select%"=="0" (goto sc_ip0)
if "%select%"=="1" (goto sc_ip1)
if "%select%"=="Q" (goto sc_exit)
:sc_exit
exit
goto :eof
:sc_ip0
cls
echo 正在设置中,请稍候
Netsh interface IP Set Address "本地连接" Static 192.168.0.99 255.255.255.0 192.168.0.1 1
Netsh interface IP set dns "本地连接" static 192.168.0.1 primary
echo 设置成功 192.168.0.99
PAUSE >nul
Goto sc_main
:sc_ip1
cls
echo 正在设置中,请稍候
Netsh interface IP Set Address "本地连接" Static 192.168.1.99 255.255.255.0 192.168.1.1 1
Netsh interface IP set dns "本地连接" static 192.168.1.1 primary
echo 设置成功 192.168.1.99
PAUSE >nul
Goto sc_main
vbs修改ip
复制代码 代码如下:
changeip.vbsstrComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each objNetAdapter in colNetAdapters
sip=objNetAdapter.IPAddress
strIPAddress = sip '保持原来的ip,如果需要修改ip为192.168.0.200:strIPAddress = Array("192.168.0.200")
strSubnetMask = Array("255.255.255.0")
strGateway = Array("192.168.0.254") '修改网关为192.168.0.254
strGatewayMetric = Array(1)
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
If errEnable = 0 Then
WScript.Echo "The IP address has been changed."
Else
WScript.Echo "The IP address could not be changed."
End If
exit for '只修改第一个网卡的设置
Next
VBS修改IP
复制代码 代码如下:
'VBS修改IP
function transh(s)
if isnumeric(s) then
if len(s)=1 then
transh="00" & s
elseif len(s)=2 then
transh="0" & s
elseif len(s)=3 then
transh=s
end if
else
transh=""
end if
end function
dim head
'机器名头
head="B"
'ip头
iphead="192.168.131"
ipgate="192.168.131"
dim i
i=inputbox("输入机器序号(2-254)")
if i="" then
msgbox "Error: 序号不正确!"
else
dim shell
set shell = CreateObject("WScript.Shell")
'修改计算机名
shell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName", head & transh(i) ,"REG_SZ"
shell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\NV Hostname", head & transh(i) ,"REG_SZ"
shell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname", head & transh(i) ,"REG_SZ"
'修改IP
shell.run "netsh interface ip set address 本地连接 static " & iphead & "." & i & " 255.255.255.0 " & ipgate & ".252 1"
'msgbox "OK"
shell.run "netsh interface ip set address 本地连接 static " & iphead & "." & i & " 255.255.255.0 " & ipgate & ".252 1"
'msgbox "OK"
shell.run "netsh interface ip set address 本地连接 static " & iphead & "." & i & " 255.255.255.0 " & ipgate & ".252 1"
'msgbox "OK"
end if
修改ip
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 《欧罗巴》评测:不是所有“禅游”都叫陈星汉
- 苏曼《好久不见》头版限量编号蓝光MQA[低速原抓WAV+CUE]
- 王家卫《繁花》电影原声3CD[低速原抓WAV+CUE]
- 群星《红色经典》限量1:1母盘直刻[低速原抓WAV+CUE]
- 苗子杰.1993-SUN.SHINE【歌林】【WAV+CUE】
- 吕方.1990-不舍得你【华纳】【WAV+CUE】
- 刘若英.2005-一整夜【大熊星】【WAV+CUE】
- 刘锐/王星《牧者影视配乐精选·贰》[FLAC/分轨][271.13MB]
- 林一峰《作业》[320K/MP3][185.25MB]
- 林一峰《作业》[FLAC/分轨][511.47MB]
- 魔兽世界永久60级奶骑天赋怎么点 永久60级奶骑天赋推荐
- 魔兽世界永久60级矮人牧师怎么玩 永久60级矮人牧师玩法指南
- 炉石传说40血卡组代码一览 2024最新全职业40血卡组代码大全
- 《如龙:极》NS实体版确认!35美元 25年3月发货
- 日本离谱忍者游戏将登NS:手柄插进屁股进行对决