Windows 7 / Getting Started

File Management

Data management is vital in any environment, and Windows is no exception. In a number of environments, storing data is worse than not storing data because data is often sensitive, and you need to ensure only the right people can get to it. In addition, as you store more data, tracking who is using data, where, and for what; ownership; the type of information; and reporting become more important.

File Ownership

The rest of this tutorial discusses NTFS, which stores data more reliably and allows other facilities because of its metadata-based approach.

One of the attributes of a file or folder is its owner. This is derived from the creator of the file or folder and can be viewed by right-clicking the file or folder, selecting Properties, selecting the Security tab, clicking the Advanced button, and then selecting the Owner tab.

If you have the correct permissions, you can change the owner to yourself or to the Administrators group using the same dialog box. If you click the Edit button, you can search the local computer's account database or an Active Directory (AD) and select any user by clicking the Other Users or Groups button. After being selected, any user can be given the ownership.

The process is identical for folders except that if ownership is modified for a folder, an additional Replace Owner on Subcontainers and Objects check box is available. If enabled, it changes the owner on subfolders and files.

Windows Vista retains the takeown command that allows the ownership of a file to be taken from the command line. A number of switches specify a remote system (/s), username (/u), and password (/p). To see all switches, use takeown /?.

Here is a basic example of taking ownership of a specific file:

D:\Documents>takeown /f music.xls

SUCCESS: The file (or folder): "D:\Documents\music.xls" now
owned by user "SAVILLTECH\mike".

To take ownership of a folder and all its content, add the /r switch for recursive execution:

D:\Documents\takeown /f . /r

SUCCESS: The file (or folder): "D:\Documents" now owned by user
"SAVILLTECH\mike".

SUCCESS: The file (or folder): " D:\Documents\music.xls " now
owned by user "SAVILLTECH\mike".

You can also use the /a switch to make the ownership go to the Administrators group instead of the current user:

D:\Documents>takeown /f music.xls /a

SUCCESS: The file (or folder): "D:\Documents\music.xls" now
owned by the administrators group.
[Previous] [Contents] [Next]