本帖最后由 tmplinshi 于 2011-4-6 11:26 编辑
- @echo off
-
- set file="list.txt"
-
- title 检查中...
- for /f %%n in ('find /v /c "" ^<%file%') do set total=%%n
- set .b=
- set /a current = 0, deleted = 0
- for /f "usebackq" %%u in (%file%) do call :Check404 "%%u"
-
- title 完成!%current%/%total% 已删除: %deleted%
- echo,
- echo 按任意键退出...
- pause >nul
- exit /b
-
- :Check404
- if not defined .b set .b=d >%file%
- set /a current += 1
- title 检查中... %current%/%total% 已删除: %deleted%
- set /p =%1<nul
- for /f "tokens=2" %%a in (' curl %1 -s -I -k') do (
- if "%%a" neq "404" (
- >>%file% echo %~1
- echo √
- ) else (
- echo ×
- set /a deleted += 1
- )
- goto :eof
- )
复制代码 下载 curl:
CURL 7.21.4
http://www.paehl.com/open_source/?download=curl_721_4.zip
CURL 7.21.4 (支持 ssl)
http://www.paehl.com/open_source/?download=curl_721_4_ssl.zip
http://www.paehl.com/open_source/?download=libssl.zip
如果有 https 的网址,要用支持 ssl 的版本,并把 libssl.zip 里的 DLL 放到 curl.exe 目录。 |