CODE: [Copy to clipboard]
REM $Id: get.proxy.bat 80 2007-12-04 08:21:12Z honghunter $
REM 原作者:lxmxn
REM 摘自:http://www.cn-dos.net/forum/viewthread.php?tid=25126&fpage=0&highlight=&page=1
REM
IF "%ORG_PATH%"=="" CALL D:\dev\dps4e\check_proxy\env_setting.bat
@ECHO OFF&SETLOCAL ENABLEDELAYEDEXPANSION&title 代理检测
IF "%1"=="sub1" GOTO sub1
:main
IF EXIST useproxy.txt DEL /a/q useproxy.txt
FOR /L %%A IN (1,1,10) DO CALL %0 sub1 %%A
START useproxy.txt
GOTO :eof
:sub1
SHIFT /1
ECHO;>>useproxy.txt
ECHO 于 %date% %time% 检测 http://www.cnproxy.com/proxy%1.html 可用代理如下: >>useproxy.txt
ECHO;>>useproxy.txt
ECHO ############################################################# >>useproxy.txt
IF EXIST proxy%1.html DEL proxy%1.html /a/s >nul
wget http://www.cnproxy.com/proxy%1.html >nul 2>nul
:html_down_ok
title 正在检测proxy%1,请稍等....
FOR /f "tokens=1,2 delims=^<trd>: " %%a IN ('type proxy%1.html ^| findstr /c:"HTTP" ') DO (
set set=
set set=%%a
SET "tempset=!set:‌‍=!"
IF "!tempset!"=="!set!" SET "tempset=!set:‍=!"
set "set=!tempset!:%%b"
ECHO 正在检测 !set! 代理,请稍等....
wget -q -T 3 -t 1 -e "http_proxy=!set!" http://www.dps4e.com -O - >nul 2>nul && echo 检测到 ******* !set! ******* 代理可用&&echo ----!set! >>useproxy.txt
)
IF EXIST proxy%1.html DEL proxy%1.html /a/s >nul
GOTO :eof
[