How to download from the command prompt?

Posted on

Question :

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


Answer :

There are several ways to solve.

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


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

wget http://endereç

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

Invoke-WebRequest http://endereç -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ç -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ç", "c:foo.file")


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

So, I’ll give you my suggestion:


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.


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


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 .


Leave a Reply

Your email address will not be published. Required fields are marked *