Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 编写批处理文件以从internet下载.exe应用程序_Batch File - Fatal编程技术网

Batch file 编写批处理文件以从internet下载.exe应用程序

Batch file 编写批处理文件以从internet下载.exe应用程序,batch-file,Batch File,我必须编写一个批处理文件来下载.exe应用程序,我发现很难理解整个过程。 到目前为止,我所做的只是 start /d C:"\Program Files <x86>\Google\Chrome\Application" chrome.exe http://website/directory start/d C:“\Program Files\Google\Chrome\Application” chrome.exehttp://website/directory 这打开了我想去

我必须编写一个批处理文件来下载.exe应用程序,我发现很难理解整个过程。 到目前为止,我所做的只是

start /d C:"\Program Files <x86>\Google\Chrome\Application" 
chrome.exe http://website/directory
start/d C:“\Program Files\Google\Chrome\Application”
chrome.exehttp://website/directory
这打开了我想去的页面,这个页面上有.exe文件,但我不知道如何下载,我试过了

start /d C:"\Program Files <x86>\Google\Chrome\Application" 
chrome.exe http://website/directory/download.exe
start/d C:“\Program Files\Google\Chrome\Application”
chrome.exehttp://website/directory/download.exe
这不好,它试图加载页面,而我认为它只会下载文件


如果有人能给我一些见解,那就太好了

您可能需要更改:

http://www.


如果您提供了实际的internet文件链接,这将有所帮助。

不要使用chrome。根据您可以依赖的工具,使用例如或。对于文档,请查看项目的主页(,),基本调用很容易:

wget -o outfile http://example.com/url/to/file
curl -o outfile http://example.com/url/to/file

我已经尝试了curl方法,我认为它是成功的,我得到了以下结果;%-100,总计-264,%-100,收到-264。。。。从这一点来看,我会说它是成功的,但我在服务器上的任何地方都找不到该文件。我以为它会进入我的默认下载文件夹,但它不在那里,我在任何地方都找不到它。关于它可能在哪里有什么想法吗?如果你从上面复制粘贴的代码,它被命名为outfile,并且位于工作文件夹中。如果您需要另一个位置,请将
outfile
更改为其他路径(例如
C:\outfile
%APPDATA%\outfile
)。我将输出更改为我的桌面位置,并收到以下错误消息
首选的POSIX等效路径是:/cygdrive/C/Users/Daniel Dold/desktop
您使用cygwin。在cygwin中,文件路径的表示方式与常规窗口中的不同。如果您希望使用cygwin,请使用建议的等效项(
curl-o/cygdrive/c/Users/Daniel\Dold/Desktop/myfilename)http://example.com/url/to/file
)。
wget -o outfile http://example.com/url/to/file
curl -o outfile http://example.com/url/to/file