|Hi again, here's a few comments on your code that I hope will help.|
IF %%O == 'PM' IF %%M%%N LSS '1200' DO (
Leave out the quotes and the DO:
IF %%O == PM IF %%M%%N LSS 1200 (
The command processor compares literally: if the left-hand side has no quotes, the right-hand side mustn't have quotes either. Unless you want to test if a variable's value contains the quotes.
The DO is not part of an IF statement, and the only reason you didn't get a syntax error reported was that the IF condition was never met.
In a stand-alone statement, the above is totally pointless: it assigns to the variable the value that it already has. But in your case, in a statement inside a FOR loop, it is worse than pointless. It assigns to CONV the value that CONV had before it entered the FOR loop. (Type SET /? and read the bit about delayed variable expansion for more information.)
Put this line:
near the top of your file, and where you have %CONV%, use !CONV! instead.
Also, be aware that this logic only works in the US and very few other countries where the filestamp is formatted that way.