存档

文章标签 ‘外网’

内外网同时上批处理文件

2008年10月15日 没有评论 2,055 views

     今天看了一下nemo的那个文件,发现它建临时文件又删临时文件(那可是四次硬盘读写呀~有点小题大做^_^hoho),算法不是很好,所以把自己的加点“人性化的语言”发布共享一下。
     10.15更新:发现自己单词拼错了~改正~^_^   另说明:此批处理文件仅适用于XP/2000,VISTA下不通过,98以下么。。估计没人用了。。。
代码如下:

@echo off
echo.
echo   Powered by Timmy
echo   ImTimmy.Com
echo.
echo   Warning!!!  Please read the following words carefully.
echo.
echo   1 : This bat is suitable for north part of ZUCC, the south part is without any tests.
echo.
echo   2 : Please ensure you have connected ZUCC-NETWORK before run this bat.
echo.
echo   3 : Do not run it again if you have reach your purpose for be online between both inside and outside network. If do, you may probably exit immediately when you press any key.
echo.
pause
for /f “tokens=3″ %%i in ('”route print | find /i “default gateway”"') do set gateway=%%i
echo.
echo.
echo   Hold on, it's working……
echo.
echo.
if not %gateway:~0,3%==10. exit
route delete 0.0.0.0 mask 0.0.0.0 %gateway%
route add 10.0.0.0 mask 255.0.0.0 %gateway%
echo   Done. Enjoy it!
echo.
echo.
echo   Attention here, if it does not work after run this bat, you may have to restart your computer and run this bat again. (I think its the best way for junior :-) ). If you still can't make it work, you can connect me.
echo.
echo   Blog:  http://imtimmy.com    
echo   QQ:4347260
echo.
pause

combinenetwork.rar

附VISTA下实现内外网同上:(thanks to nemo_a)
在内网连接的IPV4协议中将“在远程网络上使用默认网关”的勾去掉即可。

分类: IT 标签: , , ,