自动执行脚本输入IP

xeon Post in 电脑杂谈,Tags: , ,
0

上次有个user说本地链接看不到,无法设置,又不想重装,就叫他搞一个批处理,放在启动文件夹下。

固定ip地址

@echo off
netsh interface ip set address name=”本地连接” source=static 192.168.1.188 255.255.255.0 192.168.1.1 1
netsh interface ip set dns name=”本地连接” source=static 61.128.128.68
primary
netsh interface ip add dns name=”本地连接” 61.128.192.68
echo 设置完成!
echo. & pause

自动获取ip

@echo off
netsh interface ip set address name=”本地连接” source=dhcp
netsh interface ip set dns name=”本地连接” source=dhcp
echo 设置完成!
echo. & pause

将自动换行去掉,然后保存成 XX.bat,放到启动文件夹下,搞定!

参考:http://bbs.wmzhe.com/thread-113580-1-1.html

« Prev: :Next »

Leave a Reply