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:
Something like this might work:
@echo off
setlocal EnableDelayedExpansion
(
echo "Name","Modification Time","Creation Time"
for %%f in (*) do (
set "name=%%~nxf"
if not "!name!"=="%~nx0" (
set "mtime=%%~tf"
for /f "tokens=1-3" %%d in (
'dir /t:c "!name!" ^| find /i "!name!"'
) do set "ctime=%%~d %%~e %%~f"
echo "!name!","!mtime!","!ctime!"
)
)
) > output.csv