1

As mentioned in the title I need a command line that allows me to download a file in the background without installing any tool just cmd I found this one but it doesn't work in the background and Need a confirmation

C:\windows\explorer.exe https://www.website.com/file.zip

so how to make the magic happen? and is there another command that i need to add it to the above line like a confirmation !?

Govind Parmar
  • 18,500
  • 6
  • 49
  • 78
autodidact
  • 44
  • 1
  • 1
  • 6

1 Answers1

3

CMD doesn't have a built-in download command. You can download a utility like wget, and get the file with

C:\> wget https://www.website.com/file.zip

PowerShell, which is built into every version of Windows 7 and above, does have a built-in command for downloading in Invoke-Webrequest

PS> Invoke-WebRequest -Uri 'https://www.website.com/file.zip' -OutFile 'c:\temp\file.zip'

You can invoke this in one line from CMD by using the following PowerShell.exe command line.

powershell -c "Invoke-WebRequest -Uri 'https://www.website.com/file.zip' -OutFile 'c:\temp\file.zip'"
Ryan Bemrose
  • 8,148
  • 35
  • 51