Batch adjust / increment file date by an offset?

2

1

Suppose I have a folder of 100 files, and they have created/modified dates that are wrong, because the real-time-clock in the device that wrote them was wrong.

I want to add the same offset to the dates of all the files. Say 351 days, 11 hours, 5 minutes.

Is there a tool that can do this?

I have done it successfully on EXIF-containing JPGs from a camera, using the command line tool exiv2. However, it doesn't work on the MOV (video) files.

System is Win7.

gus

Posted 2014-03-30T06:32:52.240

Reputation: 174

Answers

3

Windows does not natively include a command to change the creation or modification dates of a file.

But there are external utilities that provide this functionality. A popular one is the unix touch command [ http://en.wikipedia.org/wiki/Touch_(Unix) ] ported to windows in the unxutils collection [ http://en.wikipedia.org/wiki/UnxUtils ]

Once you have this download and installed, you can then change the timestamp of the files any way you want.

touch filename.ext -t 123123592013.59

As you see, the syntax is a little weird, though.

And doing it manually for each of the 100s files will be very tiresome and error prone.

So you will probably think about automating the process. After all, automating is what computers are good at.

I suggest that you use some more powerful tool, like powershell for example.

This short scriptlet will make in powershell what you need.

ps Get-ChildItem . ^| ForEach-Object { $_.LastWriteTime=$_.LastWriteTime.addDays(351).addMinutes(665) }

PA.

Posted 2014-03-30T06:32:52.240

Reputation: 666