【问题标题】:Windows command to download a file from URL [closed]从 URL 下载文件的 Windows 命令 [关闭]
【发布时间】:2017-10-19 07:41:06
【问题描述】:

我想从 url 使用 windows 命令下载文件。我想知道windows中是否有类似wget的命令。

谢谢

【问题讨论】:

  • 在谷歌中输入“wget for windows”或类似的东西太难了……?
  • 你打算做什么,是简单的文件下载还是比较复杂?例如,可下载内容是否受密码保护,是否为“受 javascript 保护”的 URL(点击处理程序开始下载)。其他并发症也是可能的。

标签: linux windows unix cmd powershell-2.0


【解决方案1】:

我认为你可以使用这个 PowerShell 脚本:

$client = new-object System.Net.WebClient
$client.DownloadFile(“URL of file”,“Where save”)

用URL替换文件的URL,例如http://example.com/icon.png

保存位置在您的 PC 中按路径,例如 C:\Users\User\Desktop\icon.png

例如:

$client = new-object System.Net.WebClient
$client.DownloadFile("https://example.com/data.txt","D:\FileDownloaded.txt");

(对不起我的英语,谢谢)

【讨论】:

    猜你喜欢
    • 2010-11-10
    • 1970-01-01
    • 2022-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多