What you need is FileDir command line utility. You can find it in the 24x7 Tips and Scripts archive. This utility can be used to process "aged" files, in you case files having "1 day" age. If you really want to email for every "older" file then you would need to write a script type job to loop through all files and based on the file date process it or send an email. Here is a modified JAL example copied from the on-line help Dim( found_files, string ) Dim( is_empty, boolean, FALSE ) Dim( file_name, string ) Dim( file_date, date ) Dim( today, date ) Dim( fresh_file, boolean ) Dim( count, number ) Today( today ) DirEx( "k:\\web\\new\\*.htm", found_files ) IsEqual( found_files, "", is_empty ) // loop and process file by file LoopUntil( is_empty, END_LOOP ) GetToken( ",", found_files, file_name ) // Get File date and compare it FileDate( file_name, file_date ) IsEqual( file_date, today, fresh_file ) // Process file if fresh or send email if not IfThen( fresh_file, DO_COPY ) MailSend( "me@mysite.com", "password", "Old file found by job @V"job_name"", file_name ) GoTo AFTER_COPY DO_COPY: FileCopyEx( file_name, "k:\\some_destination", count ) AFTER_COPY: // check if there is more files in the list IsEqual( found_files, "", is_empty ) END_LOOP: : Hi, : I need to have JAL or VB Script do the following in the scheduler. : What I am doing is running a .exe. This .exe outputs files (excel) to a : specific directory. : After a hours or so I have another job run that does a XCopy to another : directory. : The problem is that if the date of the outputted files do NOT match the : current date the XCopy should NOT run as the data in the report is not : correct. : So I can do it two ways: 1) Run a script before the Xcopy that checks the : system date and matches it with the date of the : outputted files. If they do not match DO NOT do the xcopy. Instead send a : email to me stating that : the files are outdated. : or : 2) After XCopy completed delete all the excel files from that directory. : I need help. :-) : As always thanks for yourhelp.
|