4 posts in this topic

This may seem like a weird task, but I need to do it.

 

I have a ton of videos I have converted.  Source files are various formats, new files are all mp4.  File names of each of the new files are identical to the originals except for the extension.

 

I would like a way to have a batch file automatically take the timestamps (created/modified/accessed) from the individual, original files and clone them to the new files.

 

video1.wmv --> video1.mp4

video2.avi    --> video2.mp4

video3.mp4  --> video3.mp4

(etc.)

 

I have intermidiate experince with batch scripts, but I'm having difficulty finding out if this task is possible.  Any help is appreciated.

Share this post


Link to post
Share on other sites

I'm not an expert in Powershell by any means, but you can use this to clone those parameters onto a new file.

 

$(Get-Item NEWFILE).CreationTime=$(Get-Item OLDFILE).CreationTime
LastWriteTime and LastAccessTime will take care of the other attributes you mentioned.

I'd guess you'd need to use ForEach-Object to run through all the files.

Share this post


Link to post
Share on other sites

I don't know anything about Powershell.  What you have there looks like NEWFILE and OLDFILE would need to be manually entered.  A function called ForEach-Object would be added to automate the process for files with identical file names.  Is that right?

Share this post


Link to post
Share on other sites

Was able to do it with exiftool in a batch file.

 

exiftool.exe -tagsFromfile "C:\%%f.avi" -FileAccessDate -FileCreateDate -FileModifyDate -ext mp4 "C:\Folder with files to be changed"

 

Though, the File Access Date doesn't really work.  It set the last accessed times to the same values as the last modified values. Works well enough, I guess.

 

Thanks for the suggestion, though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.