从URL的Windows批处理文件文件下载 [英] Windows batch file file download from a URL
问题描述
我试图从网站下载的文件(例如 http://www.foo.com/package.zip )使用Windows批处理文件。我得到一个错误code当我写下面的功能:
I am trying to download a file from a website (ex. http://www.foo.com/package.zip) using a Windows batch file. I am getting an error code when I write the function below:
xcopy /E /Y "http://www.foo.com/package.zip"
该批处理文件似乎不喜欢的HTTP/之后。是否有任何逃避这些字符,因此不承担它们的功能参数的方法呢?
The batch file doesn't seem to like the "/" after the http. Are there any ways to escape those characters so it doesn't assume they are function parameters?
推荐答案
有一个标准的Windows组件,它可以达到你想要做的:的位的。因为XP和2000 SP3已经包含在Windows。
There's a standard Windows component which can achieve what you're trying to do: BITS. It has been included in Windows since XP and 2000 SP3.
运行:
bitsadmin.exe /transfer "JobName" http://download.url/here.exe C:\destination\here.exe
作业名称简直就是下载作业的显示名称 - 它设置的东西,说明你在做什么
The job name is simply the display name for the download job - set it to something that describes what you're doing.
这篇关于从URL的Windows批处理文件文件下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!