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:\\downloadpage.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