How to run a program (say calc.exe) based on the existence of some file (1.htm) through the scheduler?
I need to run a program based on the existence of some file (1.htm) on the same computer using the scheduler. I don't want to write extra code. this is possible if you are using this already on windows, e.g. for listening, etc. 1.html sometimes exists and sometimes does not exist. So strictly I only need to run (calc.exe) when 1.htm exists. Basically, I'm looking for a window listener someenind program that listens for the existence of 1.htm and triggers calc.exe to run.
THKh, Pravdin.
Pravdin,
If by no code, you don't know anything, I don't think you can.
If, however, you mean using standard Windows tools, you can use a batch file to do this. Create calcif1.cmd in the same directory where your 1.htm file should be created and paste the following into it.
@echo off
if exist 1.htm calc.exe
Then schedule the batch file to run periodically. When it finds the 1.htm file, it runs a copy of calc.
The scheduler itself does not start another instance of calcif1.cmd while the current one is running, so you won't be starting two at the same time.
source to share