Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to look in a folder for a file and have it lanuch a program

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I want to look in a folder for a file every 5 minutes to see if it changed by looking at its date and time. I would like this to be a service, I think.
is there a way to use VB script or something.
So when I turn on my computer is runs and sets in the system tray. then every 5 minutes looks in a folder for the same file "LiveTRansactions.XML name eveytime looks get its date and time, saves that then 5 minutes from now looks at the file and if the date is more recent thant oen saved Launch and Access database.
Or do I need to write this in something like VB6 or VB.NET?

Curently I'm just doing that manually. I luanch my ACC db which runs a macro and imports the XML file into a table.

TIA or any other advice, I don't want to buy something.

DougP
 
Hi DougP

This should be doable with a simple batch file running as a scheduled task to run at startup and every 5 minutes of every day. Run it using credentials which are not used as a login on the machine and it will run in the background and not be visible onscreen (like a service).

Rather than checking date and time (which also could be done) it might be easier to rename or delete the file after the db app has been completed, and at the beginning of the .bat check if exist LiveTransctions.xml and if not then exit. Otherwise invoke the db macro, which could do the rename/delete or else do it in the batch file after the db task completes.

Jock
 
You can see here a piece of code that can do that, but if the 5 minutes time is not an specific requirement, I'd go to a change notification schema like this

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top