Those among us who help out by hosting DCS files on seedboxes don't have a regular means to get up-to-date torrent files.
So I searched around and found a Windows Powershell script for monitoring a folder for .torrent files as they are created. The script will detect when .torrent files are written and then copy them to a folder of your choosing. So here it is:
$folder = 'C:\Program Files\Eagle Dynamics\DCS World OpenBeta\_downloads'
$filter = '*.torrent'
$destination = 'C:\DCSTorrent'
$fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{
IncludeSubdirectories = $true
NotifyFilter = [iO.NotifyFilters]'FileName, LastWrite'
}
$onCreated = Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action {
$path = $Event.SourceEventArgs.FullPath
$name = $Event.SourceEventArgs.Name
$changeType = $Event.SourceEventArgs.ChangeType
$timeStamp = $Event.TimeGenerated
Write-Host "The file '$name' was $changeType at $timeStamp"
Copy-Item $path -Destination $destination -Force -Verbose
}
The folder C:\Program Files\Eagle Dynamics\DCS World Openbeta\ is the default install folder for 2.5 open beta.
The subfolder _downloads is where DCS updater puts data while it is downloading it. When it starts the bittorrent client it creates a folder called .torrent and puts all torrent files in there. DCS updater usually deletes all content within the _downloads folder after it finishes, so the .torrent folder is usually not present. The script will error out if you specify a folder that doesn't exist.
You can specify your own custom destination by editing the $destination variable. Whichever folder you specify will be the destination for the .torrent files.
There's no need to alter anything other than $folder and $destination
Instructions:
Copy the contents of the script and paste it into a new text file (using notepad, notepad++, or sublime text) and save the file as DCS.ps1
Create a folder for the destination. If you didn't make any changes to the script, create a folder named DCSTorrent on your C: drive.
You can run the script from PowerShell ISE. Use the following command.
powershell -NoExit -executionpolicy bypass -File '.\DCS.ps1'
The script will remain active until you terminate it with the key combination CTRL + c
You can run the script in PowerShell, rather than PowerShell ISE. If you do, terminate the script by entering the following command.
Unregister-Event -SourceIdentifier FileCreated
Once the script is running, run the program Update DCS World OpenBeta.
As the torrent download starts, you will see messages appear in Powershell regarding which files are being processed. If all is working you will see .torrent files appear in your destination folder as well.
I'm a noob at powershell so if someone knows a better way to accomplish this I'd sure like to hear it.