Also, while we're on the subject, here's a Windows Powershell script that, when run via a task, will toggle the Alt.Binz Connect button, loop for as long as the queue isn't empty, then disconnect.
First you need to check Setup > Miscellaneous #2 > 'Enable status in XML file'
## monitor-altbinz.ps1 ##
$abstatusxml = join-path $home "\AppData\Local\Alt.Binz\altbinz_status.xml"
$abstatus = {[xml] (get-content $abstatusxml)}
function Log-DateTime
{
get-date -format "dd/MM/yyyy HH:mm:ss"
}
function Connect-Altbinz
{
write ((Log-DateTime) + " Connecting Altbinz ................")
$abstat = &$abstatus
if ($abstat.altbinz.connect -imatch "false") {
$abstat.altbinz.connect = "true" ;
try {$abstat.save($abstatusxml)} catch {sleep 3; $abstat.save($abstatusxml)}
}
}
function Disconnect-Altbinz
{
write ((Log-DateTime) + " Disconnecting Altbinz .............")
$abstat = &$abstatus
$abstat.altbinz.connect = "false" ;
try {$abstat.save($abstatusxml)} catch {sleep 3; $abstat.save($abstatusxml)}
}
function Get-DownloadStatus
{
write ((Log-DateTime) + " Checking AB download status .......")
$queue = (&$abstatus).altbinz.queuesize
write ((Log-DateTime) + " Starting queue: " + $queue)
$start = get-date
while (-not ((&$abstatus).altbinz.queuesize -eq "0.00 MB")) {
sleep 60
$speed = (&$abstatus).altbinz.currentspeed
write ((Log-DateTime) + " Download speed: " + $speed)
$queue = (&$abstatus).altbinz.queuesize
write ((Log-DateTime) + " Queue size: " + $queue)
}
$span = new-timespan $start (get-date)
$duration = ("" + $span.hours + "h " + $span.minutes + "m " `
+ $span.seconds + "s")
write ((Log-DateTime) + " Total duration: " + $duration)
}
function Log-Errors
{
$log = {foreach ($e in $error) {write $e
write "--------------------------------------------------"}}
&$log | out-file (join-path $home "\Desktop\pserrors.log") -width 50
}
Connect-Altbinz
sleep 10
Get-DownloadStatus
Disconnect-Altbinz
sleep 10
if ($error -ne $null) {Log-Errors}
Exit
To enable running your own Powershell scripts, run this command once from a Powershell window:
set-executionpolicy remotesigned