搜索论坛找到的代码:- echo=1/*>nul&@cls
- @echo off
- call :http "http://www.baidu.com/update/123.txt" C:\config\123.txt
- goto :eof
-
- ::-----------------下面是函数定义区域-----------------
- :http
- echo Source: "%~1"
- echo Destination: "%~f2"
- echo Start downloading. . .
- cscript -nologo -e:jscript "%~f0" "%~1" "%~2"
- echo OK!
- goto :eof
-
- */
- var iLocal,iRemote,xPost,sGet;
- iLocal =WScript.Arguments(1);
- iRemote = WScript.Arguments(0);
- iLocal=iLocal.toLowerCase();
- iRemote=iRemote.toLowerCase();
- xPost = new ActiveXObject("Microsoft"+String.fromCharCode(0x2e)+"XMLHTTP");
- xPost.Open("GET",iRemote,0);
- xPost.Send();
- sGet = new ActiveXObject("ADODB"+String.fromCharCode(0x2e)+"Stream");
- sGet.Mode = 3;
- sGet.Type = 1;
- sGet.Open();
- sGet.Write(xPost.responseBody);
- sGet.SaveToFile(iLocal,2);
复制代码 发现只能下载文件,不能下载文件夹。请问如果要下载文件夹是要怎么修改?文件夹内还有子文件夹,要求全部下载替换本地文件。 |