How to Download to a Specific Directory using Wget for Windows

The Wget for Windows application is of course exactly that: the classic GNU/Linux wget application built for Windows command line usage.

Of course, this means that most if not all command line switches are still available to you, just as what they would be had you been running the latest wget from your Linux distro of choice.

The question I’m answering today is how to specify which directory wget is to save what it is downloading to.

Normal usage sees wget placing whatever it grabs in the directory from which it is called.

You can of course specify a specific file to which to save your downloaded web page when downloading a single page by making use of the -O switch, resulting in something that looks like this:

“C:\wget.exe” -O “C:\download\page.txt” “http://www.download.co.za/index.html”

If however we want to specify the directory to which wget must save its downloaded content to, we need to make use of the -P switch, which the results in a call looking like:

“C:\wget.exe” -P “C:\download\” “http://www.download.co.za/index.html”

So at the end of the operation specified above, we would be sitting with a file named index.html in the directory C:\download.

And that’s how you specify to which directory wget must drag its captures down to!

Related Link: http://gnuwin32.sourceforge.net/packages/wget.htm

Related Posts :

About Craig Lotter

Craig Lotter is an established web developer and application programmer, with strong creative urges (which keep bursting out at the most inopportune moments) and a seemingly insatiable need to love all things animated. Living in the beautiful coastal town of Gordon's Bay in South Africa, he games, develops, takes in animated fare, trains under the Funakoshi karate style and for the most part, simply enjoys life with his amazing wife and daughter. Oh, and he draws ever now and then too.
This entry was posted in Software & Websites, Tutorials and tagged , , , , , . Bookmark the permalink.