UserIdleStarter is a Windows console program which runs an application when your system is idle, maybe to back up files, launch or close an application, anything you like.
The program syntax is fairly straightforward. An example command might look like this.
UserIdleStarter.exe hide 60 idle "c:\windows\system32\calc.exe"
Launch this from a batch file, and it runs UserIdleStarter; hides the console window; waits for 60 seconds when the user is idle, then launches Windows Calc (you need to specify the full path of whatever you want to run).
The timeout can be changed to suit your needs. You might also change the "idle" command to "lock" (launch a program after the desktop has been locked) or "disconnect" (wait until a Terminal/ Citrix session has been disconnected).
Windows has a very capable tool which does this already, of course: Task Scheduler. It’s far more powerful, and if you want to set up some permanent idle time task to run on your own PC, then that’s what you should use.
If you only want to run this particular idle task occasionally, though -- or maybe you’re working on someone else’s PC, and don’t want to (or can’t) modify their tasks -- then UserIdleStarter could be a simpler solution.
Either way, it’s entirely free and a mere 10.1KB download, so there’s no harm in grabbing a copy for your scripting toolkit.