Nav links

Thursday, 3 January 2013

Scheduling Radio Downloader

I use Radio Downloader to fetch podcasts on my Windows PC. It has an option to run on computer startup, but I don't want it running all the time. Instead I'd prefer it to run only briefly every few days, ideally invisibly, for just long enough to fetch the latest episodes. Luckily it provides a couple of command-line options which can help, /hidemainwindow and /exit. These, and the use of a batch file run via a scheduled task, achieve what I want.

I created a text file called RadioDownloader.bat containing the following batch commands:

start "" "C:\Program Files\Radio Downloader\Radio Downloader.exe" /hidemainwindow
timeout /nobreak /t 1500
start "" "C:\Program Files\Radio Downloader\Radio Downloader.exe" /exit
exit


The above instructions say to:
  1. Start Radio Downloader, with its main window minimised
  2. Wait for 1500 seconds (i.e. 25 minutes). This should allow enough time for podcasts to be downloaded. Note that the timeout command was added to the command shell in Windows Vista. 
  3. Close Radio Downloader
  4. End the batch file. If you don't include this line then later on you'll find the command prompt window hanging around, unwanted.
You can run the batch file manually to check it operates as desired. When you're happy add a new scheduled task into the Task Scheduler to run it as often as wanted. I do it every three days. To run the batch file with the command prompt window being minimised (thanks to kikicode) use the following action settings:

Action: Start a program
Program/script: cmd
Add arguments: /c start "RadioDownloader" /min "D:\users\General\RadioDownloader.bat"

You can hide the window completely using Windows Script or other external programs, but I prefer the simplicity of this approach.