- @echo off
- setlocal enabledelayedexpansion
-
- set "n="
-
- for /f "tokens=1-2 delims=," %%i in (www.txt) do (
-
- set /a n+=1
- set i=%%i
- set /a r=!n!+1
- set x=%%j
- if "!x!" == "001" (
- echo,Dim BinTemp, strUrl>vbsww!n!.vbs
- echo,strUrl = "!i!">>vbsww!n!.vbs
- echo,With CreateObject^("Msxml2.Xmlhttp"^) >>vbsww!n!.vbs
- echo, ^.Open "get", strUrl, False >>vbsww!n!.vbs
- echo, ^.Send >>vbsww!n!.vbs
- echo,BinTemp ^= ^.ResponseBody >>vbsww!n!.vbs
- echo,End With>>vbsww!n!.vbs
- echo,With CreateObject^("Adodb.Stream"^)>>vbsww!n!.vbs
- echo, ^.^Type ^= ^1>>vbsww!n!.vbs
- echo, ^.^Mode ^= ^3>>vbsww!n!.vbs
- echo, ^.^Open>>vbsww!n!.vbs
- echo, ^.Write BinTemp>>vbsww!n!.vbs
- echo, ^.^SaveToFile "vbsxs\xs!n!.html">>vbsww!n!.vbs
- echo, ^.^Close>>vbsww!n!.vbs
- echo,End With>>vbsww!n!.vbs
- echo,WScript.^Echo "全部执行完毕!OK">>vbsww!n!.vbs
-
- ) else (
- echo,Dim BinTemp, strUrl>vbsww!n!.vbs
- echo,strUrl = "!i!">>vbsww!n!.vbs
- echo,With CreateObject^("Msxml2.Xmlhttp"^) >>vbsww!n!.vbs
- echo, ^.Open "get", strUrl, False >>vbsww!n!.vbs
- echo, ^.Send >>vbsww!n!.vbs
- echo,BinTemp ^= ^.ResponseBody >>vbsww!n!.vbs
- echo,End With>>vbsww!n!.vbs
- echo,With CreateObject^("Adodb.Stream"^)>>vbsww!n!.vbs
- echo, ^.^Type ^= ^1>>vbsww!n!.vbs
- echo, ^.^Mode ^= ^3>>vbsww!n!.vbs
- echo, ^.^Open>>vbsww!n!.vbs
- echo, ^.Write BinTemp>>vbsww!n!.vbs
- echo, ^.^SaveToFile "vbsxs\xs!n!.html">>vbsww!n!.vbs
- echo, ^.^Close>>vbsww!n!.vbs
- echo,End With>>vbsww!n!.vbs
-
- echo,Dim objShell>>vbsww!n!.vbs
- echo,Set objShell = CreateObject^("WScript.Shell"^)>>vbsww!n!.vbs
- echo,objShell.Run "vbsww!r!.vbs">>vbsww!n!.vbs
- )
- )
- pause
复制代码
|