pl ll
asked on
Last modified file name from a folder
I want the name of last modified file from the folder download. I tried with the example given but not quite getting the correct result.
@ECHO OFF
FOR /F "DELIMS=" %%F IN ('DIR /B /A-D /OD /TW C:\Users\Username\Download s-??.xlxs' ) DO (SET FILE=%%F)
ECHO Most recently modified file is:
ECHO %FILE%
ECHO %FILE% > C:\Users\Username\Desktop\ Results.tx t
The output I am getting in Results.txt is %FILE% .
@ECHO OFF
FOR /F "DELIMS=" %%F IN ('DIR /B /A-D /OD /TW C:\Users\Username\Download
ECHO Most recently modified file is:
ECHO %FILE%
ECHO %FILE% > C:\Users\Username\Desktop\
The output I am getting in Results.txt is %FILE% .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
C:\Users\Username\Downloads\*.xlsx
»bp