台式电脑

电脑文件txt怎么样修改bat(Windows下bat脚本修改网卡ip)

1.创建一个txt文件,并把贴入如下代码:

把网卡设置ip为192.168.1.10掩码255.255.255.0网关192.168.1.0

@echooff%1mshta_vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c%~s0::","","runas",1)(window.close)&&exitcd/d"%~dp0"netshinterfaceipsetaddress"ethernet2"static192.168.1.10255.255.255.0192.168.1.0

Windows下bat脚本修改网卡ip

把网卡设置为动态获取ip

@echooff%1mshta_vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c%~s0::","","runas",1)(window.close)&&exitcd/d"%~dp0"netshinterfaceipsetaddress"ethernet2"source=dhcp

Windows下bat脚本修改网卡ip

电脑文件txt怎么样修改bat(Windows下bat脚本修改网卡ip)

贴入上述代码之后,把TXT文件修改文件类型为bat,并保存。接着把你想要更改的哪个网卡名字改为"ethernet2",或者把脚本中的ethernet2改成你的网卡名字,最好网卡名字命名为英文。中文有可能出现乱码,无法识别。

之后就可直接双击这个脚本来自动修改网卡ip了

?

相关新闻

返回顶部