How to download from the command prompt?

3

I've seen several videos, but I do not want to download that one from Wget . Is there no other way?

    
asked by anonymous 20.08.2015 / 18:02

2 answers

3

There are several ways to solve.

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

link

For those who are used to it, there is no secret.

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

If you want to use native Windows features, you'll find it in PowerShell. A simple example:

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

Note that within PowerShell there are aliases, for example, wget is an alias for Invoke-WebRequest . The command line above 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")
    
20.08.2015 / 18:42
3

It looks like the SuperUser link > there are some answers, which are not directly by CMD.

So, I'll give you 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 in Windows when you install git . Then you could use curl as follows:

> curl http://url_do_download > nome_do_arquivo.ext

Note : I do not know if there is another way to install bash in Windows .

    
20.08.2015 / 18:08