::设置要下载的文件链接,仅支持http协议。必写项。
set Url=
::设置文件保存目录,若下载至当前目录,请或滑陵留空
set Save=D:\document
for %%a in ("%Url%") do set "FileName=%%~nxa"
if not defined Save set "Save=%cd%"
(echo Download Wscript.Arguments^(0^),Wscript.Arguments^(1^)
echo Sub Download^(url,target^)
echo Const adTypeBinary = 1
echo Const adSaveCreateOverWrite = 2
echo Dim http,ado
echo Set http = CreateObject^("Msxml2.ServerXMLHTTP"^)
echo http.open "GET",url,False
echo http.send
echo Set ado = createobject^("Adodb.Stream"^)
echo ado.Type = adTypeBinary
echo ado.Open
echo ado.Write http.responseBody
echo ado.SaveToFile target
echo ado.Close
echo End Sub)>DownloadFile.vbs
DownloadFile.vbs "%Url%" "%Save%\%FileName%"
del DownloadFile.vbs
在服务族源模器端建立FTP站点,把文件放在FTP目裂念录下。假设FTP的地址是10.10.0.1, 的用户名和密码是:a/111
先写一个login.ftp,内容如下:
a
111
lcd c:\
get 1.exe
再写一个兆缓批处理myftp.bat,内容如下:
@echo off
@ftp 10.10.0.1 -s:login.ftp
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)