How to pick the latest file to archive in a folder in batch file -


i have multiple files in folder date-wise like: accnt20140127,accnt20140128,accnt20140129,accnt20140130,accnt20140131 etc

i want pick latest file ie. accnt20140131 , copy seperate folder.

can please me on this.

for /f "tokens=*" %%f in (   ' dir /o-n /b /a-d "c:\folder\accnt*"'  ) ( set "filename=%%f"  & goto done ) :done echo "%filename%" 

ordering filename, descending, first file latest. take name , exit for


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -