Windows 命令行上的 wget

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4055383/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 07:42:59  来源:igfitidea点击:

wget on Windows command line

windowscommand-linewget

提问by Tom

Basically I'm trying to download images from a website using the following command (SwiftIRC is an easy example to use):

基本上,我正在尝试使用以下命令从网站下载图像(SwiftIRC 是一个简单易用的示例):

wget.exe -r -l1 -A.png --no-parent www.swiftirc.net/index.php

This command works fine, however one of the ways I am trying to do it isn't working. When I fire up an elevated command prompt, default to windows\system32.

此命令工作正常,但是我尝试执行的方法之一不起作用。当我启动提升的命令提示符时,默认为 windows\system32。

If I use to following two commands everything works fine:

如果我使用以下两个命令一切正常:

cd c:\users\tom\downloads\

wget.exe -r -l1 etc. etc.**

The images are saved in the folder www.swiftirc.net in my downloads folder. However if I try to do this in one line like this:

图像保存在我的下载文件夹中的文件夹 www.swiftirc.net 中。但是,如果我尝试在这样的一行中执行此操作:

c:\users\tom\downloads\wget.exe -r -l1 etc. etc.

The response from wget on the cmd is exactly the same, but the images are not saved on my hard disk.

wget 在 cmd 上的响应完全相同,但是图像没有保存在我的硬盘上。

Does anyone know what I'm doing wrong?

有谁知道我做错了什么?

采纳答案by Vinnie

Try adding c:\users\tom\downloads\ to PATHor put wget.exeinto your windows/system32folder.

尝试将c:\users\tom\downloads\添加到PATH或放入wget.exe您的windows/system32文件夹。

回答by joanluc

I beleive it's because windows doesn't allow users to write files on the disk root, when you run "c:\users\tom\downloads\wget.exe" you have C:\ as a working directory so the files should be saved there but it's not allowed by the common strategies

我相信这是因为 Windows 不允许用户在磁盘根目录上写入文件,当您运行“c:\users\tom\downloads\wget.exe”时,您将 C:\ 作为工作目录,因此应该保存文件有,但这是常见的策略所不允许的