views:

223

answers:

1

Hi,

I need to start a program based on existence of some file (1.htm) on the same machine using scheduler. I don't want to write any extra code. is it possibele by using that is already on windows for e.g listener etc. 1.html sometimes exist and doesnt' exist sometimes. So strictly I need to run (calc.exe) only when 1.htm exists. Basically I'm looking for somekind of listener program on window that listens on existence of 1.htm and trigger the launch of calc.exe.

thx, Prav.

+2  A: 

Prav,

If by no code, you mean absolutely nothing, I don't think you can.

If, however, you mean using facilities in the standard Windows, you can use a command file to do it. Create calcif1.cmd in the same directory as your 1.htm file is supposed to be created, and put the following into it.

@echo off
if exist 1.htm calc.exe

Then, schedule that command file to run periodically. When it finds the 1.htm file, it will kick up a copy of calc.

The scheduler itself will not start another instance of calcif1.cmd while the current one is running so you won't get two running concurrently.

paxdiablo