I am looking to write a batch file that I can execute on all files within a folder, which will create subfolders from the “date taken” property of each file (some of these files are photos) in the format “yyyy-mm-dd”. In addition, (else statement?) I would like any file which does not have a “date taken” property (video files) to have a subfolder created matching the “date created” property. Lastly, I would like the script to move the file in question to its newly created subfolder.
I have tried some variations of the FOR command (found in other people’s questions) with limited success, but I have been able to create subfolders as “mm\yyyy\mm\dd” which nests a lot of folders instead of “yyyy-mm-dd”:
for /D %%Q IN (*.*) DO (
set FILETIME=%%~tQ
MD “!FILETIME:~0,10!”
)
How Can I Add the Date a Picture Was Taken to the File Names of My Digital Photos? May get you started.
Tony