您的位置:电脑秀首页 > 应用技巧 > 软件 > 正文

高手大懒招·批处理·绝招偷懒招术

PCSHOW.net 作者:计算机应用文摘 2008-05-07

懒招Tips·网络设置随心换

        Sky经常把公司的笔记本电脑带回家用。可家里和公司的上网方式不同,家里用路由器共享上网,IP地址是自动获取的,而公司却要使用静态IP地址。如果每次都要手工设置,那可太麻烦了。怎么办?用批处理来偷懒吧!

        Step1:在笔记本新建一个批处理文件“单位.cmd”。用记事本打开它,并输入以下内容。

        netsh interface ip delete dns "本地连接" addr=all
        netsh interface ip add address "本地连接" 192.168.0.1 255.255.255.0
        netsh interface ip add dns "本地连接" addr=61.128.128.68
        netsh interface ip add dns "本地连接" addr=192.168.0.253
        netsh interface ip add address "本地连接" gateway=192.168.0.253gwmetric=1

        Step2:在笔记本新建一个批处理文件“家里.cmd”。用记事本打开它,并输入以下内容。

        netsh interface ip set address name="本地连接" source=dhcpipconfig /flushdns

        这样设置以后,到家里面执行“家里.cmd”,但单位执行“单位.cmd”,就不用忍受手工设置IP地址的烦琐了

        想了解更多的偷懒“绝招”,敬请关注下期“高手位面”!

< 12 >
匿名评论 登录后评论
[按 CTRL + ENTER 键快速发表评论]
返回页面顶部↑