6

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
  • 20,656
  • 7
  • 53
  • 85
autodidact
  • 88
  • 1
  • 1
  • 7

1 Answers1

11

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
  • 9,018
  • 1
  • 41
  • 54