ADSrv (Auto Downloads Service) is a windows services (based on BITS) to add, remove and track downloads from several text files. Is created with .NET 4.0 (although easily adaptable to 3.5) and interact with the BITS service using the
SharpBits.Base wrapper library.
Open a cmd with admin privilege and type: AutoDownloadsService.exe /install.
Then open the services managmente console (Services.msc) and start the service called AutoDownloadsService.
Open a cmd with admin privilege and type: AutoDownloadsService.exe /uninstall.
Configuring the service
As a .NET application, you can configure it throws the app.config. The same look like:
<?xml version="1.0" encoding="utf-8" ?>
<add key="check-interval" value="5.5"/>
<add key="logs-file" value="downloads\logs.txt"/>
<add key="downloads-input-files-regex" value=".*?\.urls"/>
<add key="downloads-input-dir" value="downloads"/>
<add key="downloads-output-dir" value="downloads"/>
So, until now, you have the chance to modfy 5 parameters:
- check-interval: The minutes you want to use as the inteval to precess and update the input files (5.5 minutes in this example).
- log-files: Path to the file where you want the app write the operations logs. Can be a relative or absolute path.
- downloads-input-files-regex: Regex pattern an input file has to match to be considered (in this case, any file
with .urls extension).
- downloads-input-dir: Directory (relative or absolute
path) to search for input file that match the previous regex.
Directory (relative or absolute path) to put the downloaded files.
Note: If the supplied paths does not exist the app will try to create it.
Important: Verify that the Network Service account have read an write access to the paths specified.
Valid input files syntax:
When an input file is loaded by the app, each line is treated as a download, and most have one of the following structures:
- <remote uri> [<local file path>].
- "<remote uri with spaces>" ["<local file path with spaces>"]
- <remote uri>
- "<remote uri with spaces>"
- #Anything here because this line is a comment
(the remote file1.zip will be saved as downloads-file1.zip in the output directory).
"https://downloads.server.com/My Files/file1.zip" "C:\Users\Tom\My Downloads\downloads-file1.zip"
(the remote file1.zip will be saved in the absolute path assigned).
(the remote file1.zip will be saved as file1.zip in the outpur dir).
"file://Notwork-Server/My Files/file1.zip" "C:\Users\Tom\My Downloads\"
(the remote file1.zip will be saved as file1.zip in the supplied directory).
Note: The URIs most be valid BITS ones, see
BITS documentation for more information.
Please, enjoy it!!!!