本帖最后由 batman 于 2011-5-27 11:37 编辑
如是这样,封装下面这个批就可以了:- @echo off
- for /f %%a in (%~fs0) do set "ok=%%a"
- if "%ok%" equ "::" goto next
- (echo,&echo,:: 自动还原)>>%~fs0
- netsh -c interface ip dump >ip.txt
- attrib +h +r +a +s ip.txt
- goto :eof
- :next
- attrib -h -s -a -r ip.txt
- netsh -f ip.txt
- attrib +h +r +a +s ip.txt
复制代码 ps:同时加上了对ip.txt的保护,以防使用者误删ip.txt |