I have written a small console program that checks that all my websites are up and running properly. I use the Microsoft Windows Task Scheduler to run this program automatically once a day.
The problem is that, quite naturally, the program steals focus every time it runs. I would prefer if it would start without becoming the top-most window on my desktop. What is the simplest way to achieve this? Of course, I could rewrite my EXE to create a background window (or no window at all), but it would be nice if the Task Scheduler had an option like "Do not steal focus" or something, but maybe that is not even possible...
Answer
You could have Task Scheduler run a vbscript that opens your console program. The vbscript can use the Shell Run method to open it minimized with something like:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad.exe", 6, true
There is some basic info about this at http://ss64.com/vb/run.html
No comments:
Post a Comment