instead of what it was:
Anyone have any ideas if/how this coding can be handled in batch? Especially how to pass this - http%3a%2f%2fdownload.microsoft.com%2fdownload%2f - in a variable? I guess the best/most flexible way might be to try to find the link first using the friendly "http://download" type format, and if not found to change ":" to "%3a" and "/" to "%2f" and search again, and if found convert "%3a" and "%2f" back to ":" and "/" in order to end up with a usable link for wget. But I'm embarrassed to say that I've been away from batch coding long enough that I'm drawing a blank how best to handle all the manipulations of "%" required. Could anyone please remind me or help with the rewrite?
Here is the ReadMe for the file:
Written By - bphlpt - Well, mostly by dumpydooby, with influences by vmanda
and Pasha_ZZZ, while cheered on by 5eraph, alban, and
user_hidden, while YumeYao waved from the background.
Version - 1.5.0
Date - 2010-11-01
Download "%_DownloadPage%" "%_LinkStart%" "%_LinkEnd%" "%_DownloadWhere%"
The first four argumnets are Required, and the fifth is optional. They are:
"%_DownloadPage%" - The web page where the download link is located.
"%_LinkStart%" - The first part of the link you want to match.
"%_LinkEnd%" - The last part of the link you want to match.
"%_DownloadWhere%" - Where the downloaded file should be stored.
"%_StatusOut%" - This can be any valid redirection path - filename, the
console, or even nul. If this argument is omitted, the
StdOut, or console, is used.
NOTE: Each argument should be enclosed with quotes ["]
This program finds a download link specified as "%_LinkStart%***%_LinkEnd%"
on the web page "%_DownloadPage%" and downloads that file to
"%_DownloadWhere%" using wget. It has been tested to work using XP and Win7
specifically for Microsoft's DirectX download page.
This program began from my need for this funtion by my "DirectX file
Collector and addon Builder", see here -
"http://www.ryanvm.net/forum/viewtopic.php?p=108233". dumpydooby suggested
adding the function, and after I was originally unsuccessful in its
implementation, vmanda came up with a great tool that filled the need. But I
was stubborn and still wanted to do my own version. As I was just starting
to experiment with VBScript, Pasha_ZZZ provided a perfect tool using JScript.
But before I had time to roll out the DXCB including Pasha_ZZZ's great code,
dumpydooby came back with essentially the same code in VBScript but with
enhanced wget funcionality. That became the basis for this code. I merely
shined it up a bit, generalized it, added a variable output stream, added
error checking and documentation, and corrected a few "gotcha's" we've all
learned from. 5eraph, alban, user_hidden, and YumeYao helped immeasurably
with testing. This would not have been possible without the help of
Dependencies: wget must be located in the same directory as this file and the
first four arguments specified above must be defined.
Upon Exit, ERRORLEVEL is set to 0 if all went well, 1 if no links were found,
and 2 if there was a problem trying to download the link with wget.
This is an example of a way to use Download:
@ECHO OFF & SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
(Call Download %_DownloadPage% %_LinkStart% %_LinkEnd% %_DownloadWhere% con)
Exit /B 0
Any download link in the format "%_LinkStart%***%_LinkEnd%" that is found on
"%_DownloadPage%" will be downloaded by wget and put "%_DownloadWhere%" unless
the file already exists there and has a date code no older than that of the file
on the "%_DownloadPage%". In this example, status will be provided on the
StdOut, or "con", including a running status in the Title bar.
The download includes:
2010-11-01 -- Version 1.5.0 -
Improved reliability of Downloader with code tweaks
2010-09-13 -- Version 1.0.0 -
Thanks in advance for any and all suggestions anyone can provide.
Cheers and Regards
Number of downloads: 8