I'm not sure the format you specified is safe, are the minutes actually correct? (the month might be used instead)

The file names seem ok, they reflect the actual date / and time down to the second when the file was written.



What is the value of strThisTime when the error occurs? Is there already a file with that name?

The first file written with the fixed name always exists. The second one of course doesn't due to the exact time being part of the name. The files are typically written once per hour.