I'm looking for an easy way to get a string that I can parse out the last modified time of a file
I have a script that processes all the files in a directory and I use the getfilelist and separate command - it works like a charm unless new files are being created and placed in the folder
Let me explain the files being processed by the script are image files that are created in the file folder (not copied in). Since the files are large they take some time to create. What happens is that as the file is being created the file name is created before the file is finished being created. (makes sense when you think about it) However, the Getfilelist command reads this file name and tries to process it. When this happens the file processing fails.
So, I am looking for a way to get the time in minutes from a file name. I was thinking of the Dos directory command and writing all the file names to a text file. Parse out the text file and use the VB Script Minute(Now) and only process the files that are two or more minutes old.
However, this script replays is self every minute, even it there are no files to process. I don't want to create and delete a text file every minute if there are no files to process. Or only one or two files.
file last modified time - Command
Moderators: JRL, Dorian (MJT support)
kpassaur,
Just a thought.
Instead of parsing for time, would this work:
Use GetFileList to create list1
Wait>60
Use GetFileList to create list2
Wait>60
Use GetFileList to create list3
Process list1
Wait>60
Use GetFileList to create list4
Process list2
Wait>60
Use GetFileList to recreate list1
Process list3
Wait>60
Etc....
Subroutines and an endless loop
Hope this helps,
Dick
Just a thought.
Instead of parsing for time, would this work:
Use GetFileList to create list1
Wait>60
Use GetFileList to create list2
Wait>60
Use GetFileList to create list3
Process list1
Wait>60
Use GetFileList to create list4
Process list2
Wait>60
Use GetFileList to recreate list1
Process list3
Wait>60
Etc....
Subroutines and an endless loop
Hope this helps,
Dick
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Here is a single line of DOS commands that results in a single line file with data and time in the first 18 characters. Processes involved:
1. Do a directory listing for the specific file.
2. Pipe the result into FIND to get the single line result.
3. Redirect the result into a text file to read and parse.
Sample result:
12/14/03 05:34 AM.................... 24,673 Filename.ext
So you could use:Then read that single line and parse it.
1. Do a directory listing for the specific file.
2. Pipe the result into FIND to get the single line result.
3. Redirect the result into a text file to read and parse.
Code: Select all
Dir C:\SourcePath\Filename.ext|Find /I "Filename.ext" >lasttime.txt
12/14/03 05:34 AM.................... 24,673 Filename.ext
So you could use:
Code: Select all
Run Program>command.com /c Dir C:\SourcePath\Filename.ext|Find /I "Filename.ext" >lasttime.txt
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!