My batch script failed on a different system using 'FOR /F' processing DIR output.
I tested on Windows 7 (32bit and 64bit) and Windows 8.0
My victim is running Windows 10 over 8.1. Here is a excerpt of my correspondence:
Code: Select all
. . . it's always a simple one as you know.
There is indeed a difference and it is in the default output of the 'DIR' command.
Your test run showed:
Directory of E:\Temp\Spflite_Dir1
11-Mar-16 13:47 <DIR> Dir2
11-Mar-16 13:47 <DIR> Dir3
We on the old systems got:
Directory of C:\Users\Zani\AppData\Local\Temp\ForCmdDiag_Dir1
03/12/2016 01:02 PM <DIR> Dir2
03/12/2016 01:02 PM <DIR> Dir3
So, without the AM/PM designation, I was never going to find the '<DIR>' token and all of the Directory processing goes kaput.
So basic, but who knew they would change that, watching from my island. At least, now I know what to do. I just have to figure out how.
I don't know if this date/time format change came with 8.1 or 10, but when MS did this, can anyone let me know if they added a switch to 'DIR' for compatibility as they have in the past? That would certainly save some re-coding if I could catch this at the source of that data instead of manipulating it.
Thanks,
John A.