- Jan
- 755
- 16
In a directory, I have different files such as ...
C_VOL-b516.spf
C_VOL-b515.spf
C_VOL-b514.spf
C_VOL-b513.spf
To find out which is the file with the lowest number (is the oldest file), I used till now the following command sequence (within this directory):
FOR /F %%i IN ('DIR C_VOL-b*.spf /B /Ord') DO @SET OldestFileInDirCVolSPF=%%i
and then the variable %OldestFileInDirCVolSPF% ...
this is no more possible - the variable is empty now.
What is here the problem?
Thank you very much for help in advance!
Kind regards
Alpengreis
EDIT ...
PS: I can not test for the oldest file date (the date is not ALWAYS relevant, I can only test for the numbers within filename - the lowest number is always the oldest for my purpose ...
C_VOL-b516.spf
C_VOL-b515.spf
C_VOL-b514.spf
C_VOL-b513.spf
To find out which is the file with the lowest number (is the oldest file), I used till now the following command sequence (within this directory):
FOR /F %%i IN ('DIR C_VOL-b*.spf /B /Ord') DO @SET OldestFileInDirCVolSPF=%%i
and then the variable %OldestFileInDirCVolSPF% ...
this is no more possible - the variable is empty now.
What is here the problem?
Thank you very much for help in advance!
Kind regards
Alpengreis
EDIT ...
PS: I can not test for the oldest file date (the date is not ALWAYS relevant, I can only test for the numbers within filename - the lowest number is always the oldest for my purpose ...
Last edited: