Windows batch file to create csv list of file and dates

后端 未结 5 899
遥遥无期
遥遥无期 2021-01-15 13:39

I need to create a Windows batch file that generates a .csv file with three fields for all the files in a directory (minus the batch file itself!).

Fields:

5条回答
  •  旧巷少年郎
    2021-01-15 14:01

    try this:

    @ECHO OFF &SETLOCAL
    (FOR /f "delims=" %%a IN ('dir /b /a-d') DO (
        FOR /f "tokens=1-3*" %%x IN ('dir /a-d /tc "%%~a"^|findstr "^[0-9]"') DO (
            ECHO "%%a",%%~ta,%%x %%y %%z
        )
    ))>DIR.csv
    TYPE DIR.csv
    

提交回复
热议问题