How to download from the command prompt?

I've seen several videos, but I don't want to download that one of Wget. Is there no other way?

Author: Wallace Maxters, 2015-08-20

2 answers

There are several ways to solve.

If you want something similar to *nix systems, there is wget for windows:

Http://gnuwin32.sourceforge.net/packages/wget.htm

For those who are used to it, it has no secret.

wget http://endereço.do/arquivo/para.baixar

If you want to use native Windows resources, you will find in PowerShell. A simple example:

Invoke-WebRequest http://endereço.do/arquivo/para.baixar -OutFile c:\foo.file

Note that inside PowerShell there are aliases, as an example, wget is an alias for Invoke-WebRequest. The above command line can be written as follows

wget http://endereço.do/arquivo/para.baixar -OutFile c:\foo.file

Just be aware that the alias has nothing to do with wget, popular on linux platforms.

Still in PowerShell, another way to download:

(new-object System.Net.WebClient).DownloadFile( "http://endereço.do/arquivo/para.baixar", "c:\foo.file")
 3
Author: Daniel Omine, 2015-08-20 16:42:04

It seems that in the link of the superuser there are some answers, which are not directly by the CMD.

So, I'll give my suggestion:

PHP

PHP can also be used on the command line. We can then read a file through readfile and save it to a file on your computer.

See:

> php -r "readfile('http://url_do_download');" > nome_do_arquivo_baixado.ext

CURL

Another Way would be through bash, which is always installed on Windows when you install git. Hence you could use curl as follows:

> curl http://url_do_download > nome_do_arquivo.ext

Note : I don't know if there is another way to install bash on Windows.

 3
Author: Wallace Maxters, 2017-03-20 10:04:43