对于经常使用笔记本电脑在两地上网的朋友,切换网络配置就成了家常便饭,总是该来该去实在麻烦,用bat文件可以使一切都变得简单。   
  首先选择“开始→运行”,输入:cmd,回车后进入命令行界面,然后输入:netsh -c interface dump>d:home.txt,回车后,系统将会把你当前的网络配置备份到d盘的home.txt文档中。    
  然后开始编写bat文件,只有简单的一行:netsh -f d:home.txt,保存为bat文件,以后双击该文件就会应用home.txt中的网络配置。如果你觉得两个文件烦,也可以将两个文件写成一个bat文件:   

  @echo off 
  //设置本地连接的ip地址为:192.168.10.100,子网掩码为:255.255.255.0 
  netsh interface ip set address name="本地连接" source=static addr=192.168.10.100 mask=255.255.255.0 
  //设置网关 
  netsh interface ip set address name="本地连接" gateway=192.168.10.1 gwmetric=0 
  //设置主dns 
  netsh interface ip set dns name="本地连接" source=static addr=192.168.10.2 register=PRIMARY 
  //设置备份dns 为空
  netsh interface ip add dns name="本地连接" addr=none 
  //设置wins 
  netsh interface ip set wins name="本地连接" source=static addr=none