Renaming, and resetting created, modified and accessed dates

Hi hope someone can point me in the right direction.

I have a number of folders (about 50) containing approx 50 MS Word files in each folder, I need to rename each file in each of the folders with a prefix "Chk " and reset the created, modified and accessed date and time to 01/01/2008 00:00:00 and also set the revision number to 1. When this is done these dates and times need to show correctly in both the General and Summary properties of the files from Opus AND from the General and Statistics properties when the actual files are opened in MS Word.

Can anyone offer a solution please?

many thanks


Just to warn you before you start reading, Opus can do some of what you need itself but not all of attributes can be set using Opus alone. I'll mention specifics below...

Opus provides several ways to tackle files in multiple folders. Which is best probably depends on exactly how the folders are arranged and what else is in them.

One way is to do a Find on the folders, so that you get a list of the files you are interested in. (e.g. Find *.doc from the parent of all the folders.)

Another way is to use Flat View mode which makes Opus show the contents of the current folder and all sub-folders, all at once. (This can be either grouped like a tree, or in a flat list as if all the files were in the current directory, even though they are not.)

A third way is to use recursive filters, but I think they'd just complicate things in this case, so my advice is to pick either Find or Flat View.

Once you've got your list of files, select all the documents you want to act on...

...with the files selected, right-click the Rename button on the toolbar to access the Duplicate Files action. (On the default toolbar the Rename button is between the Create Folder and Delete File buttons.)

A small window titled Copy As - Directory Opus should appear, with Old name and New Name fields.

Set the old name to: *
Set the new name to: Chk *

Click OK and all the selected files will be copied to new files with the "Chk " prefix.

Select the files you want to do this to and then use File -> File Commands -> Set Attributes from the menu. (Assuming you haven't changed your menu from the default one.) You'll see a window where you can specify the creation and last modified times. Set them as you wish and then click OK.

You cannot set the Accessed time using Opus. It usually isn't worth setting a file's Accessed time, either, since so many passive actions can modify it, but if you really need to it would be easy for me to quickly write a tool that you can use with Opus to do it. Shout if you want that.

Opus cannot modify the document attributes which Word stores in its files, such as the revision number. You'll need a 3rd party tool for doing that, but if you find one with a command-line interface then it should be easy to integrate it into an Opus button so that you can use Opus to find & select all the files and then click the button to apply the program to each of them.

From what I remember, which may be wrong, Word also stores its own created, modified and accessed timestamps inside of its documents and ignores the timestamps on the files themselves. Again, Opus isn't able to modify those without the help of another tool.

Thanks for this
I can manage most of that. The one exception is the accessed time. I appreciate what you say here about many things can change the access time, but believe it or not there is a strange reason for setting it to a specific date and time.

Consequently it would be more than helpful to have a tool that could do that please.

I think you are right about Word keeping its own dates and revisions. I'll give that issue an airing on a Word forum and see what happens.

Many thanks
Rich aka Trickyrla

I just remembered that there's already a command you can use to do this. Download the touch.exe program in the zip attached to this post:

[Remote Logon and copied file timestamp problems)

You can use it to set the accessed, created and modified timestamps, all at once, to midnight 01-01-2008 using this command in an Opus button:

(This assumes touch.exe is in the PATH. If it isn't then use the full path to wherever you have put touch.exe and don't forget to put quotes around it.)

touch.exe -c -a -C -m -t 200801010000 {filepath$}

Note: The lower-case -c tells the tool not to create the file if it isn't found. It's the upper-case -C that tells it to change the creation time. The -a makes it change the accessed time and the -m the modified time.

By the way, it seems that on Vista (but default) the accessed timestamp is no longer fragile because Vista defaults to turning on the registry setting which prevents NTFS from automatically updating the accessed timestamps (apparently for a performance increase). Of course this also means that the accessed timestamp may lose its usefulness on Vista, unless you modify it yourself, since it will almost always be the same (rounding aside) as the creation time.

Many thanks
I'll try this and let you know how it goes

Rich aka Trickyrla