A file parameter setting command line tool for Windows NT 4.0
This document describes the tool setfile.exe. This tool can be used to set the different time values and the owner of Windows NT files residing on an NTFS file system. Later version of the program may allow changes to other parameters as well.
Introduction
Windows NT NFTS file system stores several information about files. Among these are
the creation time of a file, when the file was created
the modification time of a file, when the file last time was written (this is the time explorer list in detailed view)
the access time of a file, when the file last time was accessed
the owner of the file.
The tool setfile can be used to modify the owner as well as any of the time values of a file.
Installation
There is no need to install the program. The package you have downloaded should contain the file named setfile.exe. Copy this file into an appropriate location from where you can start it using the command line.
Using setfile
To start setfile you have to type the command:
setfile options file
where setfile is the name of the executable, options tell setfile what to do and file is the name of the file to alter. The options follow the OpenVMS notation. The options are:
/RECursive recourse subdirectories
The specified file name may contain wild card characters and all the files in the directory that matches the pattern will be changed. If this option is used the subdirectories are also checked for matching files.
/QUIet do not report errors except fatal
/VERbose print information about actions
/DOMain=domain where the desired file owner belongs
When the owner of the file is set the user name specified will searched in the local user database unless a domain is specified using this option.
/OWNer=owner the desired owner
If you specify this option the specified owner will own the files. To do this you need appropriate privileges. In other words be member of the Administrators group.
/NODirectories skip directories
/USAge prints usage
/Help prints usage
/CTIme=time set creation time
/MTIme=time set modification time
/ATIme=time set access time
Set the creation time, modification time and access time of the files. One or more time values can be set in a command. The format of the time specification should be YYYY-MM-DD hh:mm:ss. You need not specify all parts of the time value, you can omit the month, day, hour, minutes and seconds, but you have to specify any part if a following part is specified. For example you have to specify the month if you wan to specify the day. If a part is missing it is treated as January 1, 00:00:00. To separate the values you can use any non-digit character, but the format above is the most readable. To have space inside the option you have to close the value into “ characters, like:
setfile /mtime="1980-03-21 12:23:42" /Rec *.*
The options can be shortened. You have to write at least three characters, except in case of the HELP options.
Acknowledgements
Most of the code was taken from the program chown created by
Alexander Frink
Hermann Schauss Str. 8
65232 Taunusstein
Germany