Batch program
Hello veveryone,
I have a situation where a log file is generated throughout the day with the final log created at night between 11:00pm and 1:00am the next morning and is named according to the date it is for, ex040918 (ex((yy,mm,dd))) for Sept.18,2004, ex040930 for Sept. 30, 2004, ex041001 for Oct. 1, 2004. I need to create a batch program to run after 1:00am that will copy the log for the previous day to an existing directory. For example: ex040919 created 9/20/04 12:05am and ex040920 created 9/20/04 12:30am exist and at 1:00am the batch program has to copy ex040919 to the directory. Or ex040918 created 9/19/04 12:03am, ex040919 created 9/19/04 11:55pm and ex040920 created 12:20am 9/20/04. File ex040919 needs to be copied. Sorry for being long winded but my head is spinning.
Thank you for any help and guidance.
I have a situation where a log file is generated throughout the day with the final log created at night between 11:00pm and 1:00am the next morning and is named according to the date it is for, ex040918 (ex((yy,mm,dd))) for Sept.18,2004, ex040930 for Sept. 30, 2004, ex041001 for Oct. 1, 2004. I need to create a batch program to run after 1:00am that will copy the log for the previous day to an existing directory. For example: ex040919 created 9/20/04 12:05am and ex040920 created 9/20/04 12:30am exist and at 1:00am the batch program has to copy ex040919 to the directory. Or ex040918 created 9/19/04 12:03am, ex040919 created 9/19/04 11:55pm and ex040920 created 12:20am 9/20/04. File ex040919 needs to be copied. Sorry for being long winded but my head is spinning.
Thank you for any help and guidance.
0
Comments
Example: In a batch file I think it would be (make a new text document and save it with the extension as .bat or .cmd):
I may be wrong since I've never really had to use batch files (or command line for that matter) that much. I suggest you test it on another machine or with a dummy file.
Thanks for your help. I used an exe file to manipulate the date format, with a date offset, to resemble the names of the logs (ex040920.log), assign it to a variable and copy yesterdays log using the variable. It worked on all the tests I ran anyway.
Thanks again,
Maximus