迅维网

标题: 用批理控制上网 [打印本页]

作者: yingcaichen    时间: 2010-6-24 10:11
标题: 用批理控制上网
今天收到客户一个需要,就是自己下班时自己的电脑不想让别人上网,但可以连内网。因为客户对电脑 了解并不多,连IP地址是什么都不知道。所有想出了用批处理来控制上网,只需客户双击运行批处理即可。

把下面代码复制到记事本,另存为"上网.bat"
@echo off
netsh interface ip set address name="本地连接" source=static gateway=192.168.1.1 gwmetric=1
netsh interface ip set dns name="本地连接" source=static addr=202.96.128.86

把下面代码复制到记事本,另存为"断网.bat"
@echo off
netsh interface ip set address name="本地连接" source=static gateway=192.168.1.251 gwmetric=1
netsh interface ip set dns name="本地连接" source=static addr=192.168.1.251

上面的“本地连接”根据所在电脑的网卡名称而定。
对直接拨号上网的没试过,不过也没必要试,因为直接不保存ADSL密码就行了,呵呵。。

对于懂一点电脑的客户来说,上面的笨方法是无效的,因为他们会懂得自己手动修改IP上网。

作者: 天煜科技维修    时间: 2010-6-25 12:45
管用么 试试
作者: gchuser    时间: 2010-6-25 16:32
只是改了网卡的DNS而已.




欢迎光临 迅维网 (https://www.chinafix.com/) Powered by Discuz! X3.4