I just replaced my old (Windows XP) computer by a new one (Windows 7). Thus, I am working with a new user. How can I change the file ownership of my files on my various external HDDs to the new user? I'd like to change only the files that belonged to a certain old user.
3 Answers
Check out CACLS - it's built into Windows 7.
"CACLS is a Windows NT command-line utility that is used to display or modify file or directory access control lists (ACLs)."
A quick but inelegant way to find who owns files is to enter the following at a command prompt: dir c: /q /s > FilesOwner.txt
Assuming c: is the drive you are working on.
The /q
will add the owner to the directory listing
Most files will get updated after you change the containing folder, but you can find any odd files by piping the results to the find command: dir c: /q /s|find "myusername"
-
+1: Excellent way to find his files for sure. I forgot about dir /q. Too long in GUI. ;) Mar 4, 2011 at 1:56
In Windows 7 there is also the program takeown for this purpose. For example:
takeown /F . /R
changes the ownership of the current directory and its subdirs to the current user.