DOS Batch to set file Last Modified date as another file
Posted on 2011-02-27
In my work I take many video files as records using digital camera. Then I convert them to MP4 to save space, then I will delete the original MOV files. However, all video converters I've tried lack the ability to keep the output files' Last Modified Date as the original input files'.
I've tried many different programs (SetFileDate, FileDate etc.) but they all set file date to a particular or relative date/time, not using the date from another file. (The Linux TOUCH tool seems able to do this, but the Windows versions lack this function)
In my scenario, after conversion, the original and output video files are typically of same file name and in same folder, but have different extension::
Is there a way to scan all the MP4 files in a folder and copy the Last Modified Date from the corresponding (i.e. same filename, different extension) MOV?
I prefer a command line batch solution so that I can modify in future, but VBScript is also ok.
I use WinXP and Win7.