Link to home
Start Free TrialLog in
Avatar of IT CAMPER
IT CAMPERFlag for United States of America

asked on

Custom script needed to check existence of files

I need a custom script or batch written to check for the existence of two daily files that should exist for the next day. More specifically, we have a scheduler system that should be exporting a proprietary file for the next day. If this file does not get created then someone needs to be alerted prior to midnight when that file would need to be used. The scheduler is creating two files for each day so we would need to check for both. The format of the files is MEGA%MM%%DD% and BLAZE%MM%%DD%, where %MM% is the 2-digit month and %DD% is the 2-digit day of the month. Example of files: MEGA0913 and BLAZE0913. Neither file has a file extension so Windows just sees them as a type 'file'. I plan on using task scheduler to check for both files at 9pm of the day before. So on the 13th, the script would run at 9pm and be looking for MEGA0914 and BLAZE0914. Both files reside in the same folder. If either of the files is missing then the script needs to send an email, using BLAT or similar to alert an email address as to which file(s) are missing.
Avatar of arnold
arnold
Flag of United States of America image

Do you have an existing system that monitors your environment?
Some include the ability to monitor a file system for an event.

in your case though you are looking for a negative monitoring alert.

In the formulation of your question, you might fair better to post it as a gig?

commonly, in such a setup, I would have the process that generates the files generates the email on a successful conclusion of the process or if it runs into issues to generate an email.

Presumably, your situation is in the event the process is terminated outside the normal process, system rebooted, etc.

any reason why batch file not a powershell or a vbscript where it can be located in the folder and search the directory.....

includes more granular tools.
Hi murryc,
Your question is similar to the one solved in these EE threads:

https://www.experts-exchange.com/questions/29155232/Program-to-check-for-new-files.html
https://www.experts-exchange.com/questions/29155672/Setup-CDO-for-Office365.html

The solution there is an AutoHotkey script that sends an email via CDO or PowerShell (it uses an SMTP server of your choosing...Comcast, Gmail, Hotmail/Outlook, whatever). Let me know if that approach interests you and I'll look into what it would take to customize the script to meet your exact requirements. Regards, Joe
you might fair better to post it as a gig?
Hi Arnold,
I think you're absolutely right about that! Unfortunately, Experts Exchange killed Gigs a while ago, and also killed the HireMe button. This is definitely one of those questions requiring custom development that could go beyond what is reasonable for pro bono work. Although Gigs and HireMe are gone, EE now allows discussion of paid work via PM. Regards, Joe
Avatar of Bill Prew
Bill Prew

There are some scripting solutions, and also third party products, that you might be able to use / adapt...



»bp
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@murryc,

Are you all set with this now, or do you need more help?  If all set, could you please close it out now.  If you need help with the question close process take a look at:



»bp