Take / Assign Ownership of file / folder

karlsnooks

New member
Guru
Gold Member
VIP
Local time
3:56 AM
Messages
10,200
Location
Austin, Texas
Brink has written an excellent tutorial on this, however, for those of you who prefer to "roll your own":

Take Ownership of file - Vista Forums


Taking Ownership of Files and Folders
As an administrator you can take ownership of a file or folder as follows:
1. In Windows Explorer, rt-click on "properties" for the file or folder.
2. Security tab | Advanced
3. Owner tab| click Edit
4. In the Change Owner To list, select the new owner. To take ownership of all subfolders and files within the folder, select Replace Owner On Subcontainers And Objects option.
5. OK | OK

Assigning Ownership
As administrator or the current owner, you can assign ownership to another user or group as follows:
1. In Windows Explorer, rt-click on "Properties" for the file or folder.
2. Security tab | Advanced
3. Owner tab | Edit
4. Click Other Users Or Groups
5. Type the name of a user or a group | click Check Names | Choose the name you want if its not already filled in | OK
6. From the Change Owner list, select the new owner. For a folder, select Replace Owner On Subcontainers and Objects to assign ownership of all subfolders and files within the folder.
7. Ok | OK

karl
 
Last edited by a moderator:

My Computer My Computer

At a glance

MS Windows 7 Ultimate SP1 64-bitAMD A10-4600M6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28)AMD Radeon HD 7660G
Computer Manufacturer/Model Number
Toshiba Satellite S875D-S7239 laptop
OS
MS Windows 7 Ultimate SP1 64-bit
CPU
AMD A10-4600M
Motherboard
AMD Pumori (Socket FT1)
Memory
6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28)
Graphics Card(s)
AMD Radeon HD 7660G
Sound Card
High Definition Audio Device
Monitor(s) Displays
Generic PnP Monitor (1600x900@60Hz)
Screen Resolution
1600x900@60Hz
Hard Drives
SSD 119GB Corsair CSSD-V128GB2 ATA Device
Keyboard
Standard PS/2 Keyboard
Mouse
HP Wireless Optical Mobile Mouse Model FHA-3410
Internet Speed
What the local pub, local coffee shop offers.
Other Info
Optical Drive:MATSHITA BD-CMB UJ160B ATA Device


Also have an Asus ha1002xp netbook with Win 7 Ultimate installed.
Thank you for providing the above information. However, I keep seeing people on this forum saying they want to be the BOSS I want full control without understanding what they are doing and want to take ownership of every file and remove all others.....then 30 minutes later they are asking why their machine is crashing why it is doing weird stuff why this is not working, why they cannot install or uninstall software. Holy Cow you just took ownership of everything and the system has no access!!! Duh! You can’t uninstall or re-install or anything.

If you (anyone) really want to take ownership of every file on the machine spend the time reading "Windows 7 Resource Kit" and "Windows 7 Inside Out" cover to cover twice and then do some research on the internet for several months. This way you can be absolutely sure you know what you are doing.

I would add a disclaimer to your tutorial.

:: WARNING! Making these changes without completely understand the full effects; can or will result in requiring a complete clean reinstall of your operating system (i.e. Windows 7).
 

My Computer My Computer

At a glance

Windows 7 Enterprise (x64); Windows Server 20...16GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
Ok, I understand the warning. I wish I had the time to read all that fun stuff. Seriously, I really do. But I don't. I'm a network admin, author and Web Developer, I need to use Windows 7, not study it. I just want to do one little thing, that was trivial in WinNT, Win2k, WinXP .... but seems to be nearly impossible and/or dangerous in Win7 ....

I'm just trying to fix the horrible harsh white explorer window backgrounds so that I can join the rest of the world who uses Aero without blinding myself. Is this too much to ask? I don't want to break my system. I just want it to not blind me when I'm using an Aero theme.

Through much reading and research I have learned that I need to muck with aero.msstyles. Have created a modified version that hopefully has subdued grey backgrounds like I enjoy with Classic theme. Have saved the original aero.msstyles in several places, also on thumb drive. I *think* I need to delete it and rename my modified version, then logout and back in. But, even though I have Taken Ownership of the darn thing, I still can't delete it.
aero.msstylesClassicIsNiceandGrey.JPG
CantDeleteEvenThoughIamtheBOSS.JPG

Any help much appreciated. Been working on this for months, off and on.

Thanks,

$teve
 

My Computer My Computer

At a glance

Windows 7 Pro x64 (dual-booting XPSP3 and Win7)Intel Core-2 Quad4GB 800 Mhz PC2 unbuffered ECCNVIDIA Quadro FX 570
Computer Manufacturer/Model Number
Dell T3400
OS
Windows 7 Pro x64 (dual-booting XPSP3 and Win7)
CPU
Intel Core-2 Quad
Memory
4GB 800 Mhz PC2 unbuffered ECC
Graphics Card(s)
NVIDIA Quadro FX 570
Sound Card
Creative SB X-Fi model SB0770
Monitor(s) Displays
Dell 19" FP
Screen Resolution
1680x1050
Hard Drives
SATA disk0 250GB disk1 500GB
Internet Speed
TW RR
Other Info
Just a baby compared to my work box!
Note: This will delete the file and there is NO quick recovery if you type the wrong file name in, so please be extremely careful. Create a restore point if you want to have a backup.

Open an elevated Command Prompt and type:

Code:
c:
cd c:\windows\resources\themes\aero
takeown /F aero.msstyles /R /A
attrib -r -s -h aero.msstyles 
del aero.msstyles /q
 

My Computer My Computer

At a glance

Windows 7 Enterprise (x64); Windows Server 20...16GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
that might work if you first change to the right folder

CD \windows\resources\themes

and also spell it aero.msstyles not areo.msstyles
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
that might work if you first change to the right folder

CD \windows\resources\themes

and also spell it aero.msstyles not areo.msstyles

Good catch...I fixed it.
 

My Computer My Computer

At a glance

Windows 7 Enterprise (x64); Windows Server 20...16GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
Thanks WindowsStar and OldBloke. I appreciate the details; prefer command prompts when they facilitate things.

Still having problems, though. The errors I get via cmd prompt are the equivalent of what I'm getting via GUI efforts. Dir /Q shows I'm already the owner, having taken ownership last night via GUI. It is as if something is locking the file. I'm using a Classic theme during all of this. Wondering if Win7 is using aero.msstyles while I'm trying to work with it?

Code:
C:\Windows\Resources\Themes>dir
 Volume in drive C is WIN7
 Volume Serial Number is 38E3-D77A

 Directory of C:\Windows\Resources\Themes

07/14/2009  01:45 AM    <DIR>          .
07/14/2009  01:45 AM    <DIR>          ..
03/19/2010  08:29 PM    <DIR>          Aero
06/10/2009  02:57 PM             1,897 aero.theme
06/10/2009  02:57 PM             2,376 architecture.theme
06/10/2009  02:57 PM             2,366 characters.theme
06/10/2009  02:57 PM             2,360 landscapes.theme
06/10/2009  02:57 PM             2,319 nature.theme
06/10/2009  02:57 PM             2,326 scenes.theme
               6 File(s)         13,644 bytes
               3 Dir(s)  414,666,899,456 bytes free

C:\Windows\Resources\Themes>cd Aero

C:\Windows\Resources\Themes\Aero>dir *.* /Q
 Volume in drive C is WIN7
 Volume Serial Number is 38E3-D77A

 Directory of C:\Windows\Resources\Themes\Aero

03/19/2010  08:29 PM    <DIR>          NT SERVICE\TrustedInsta.
03/19/2010  08:29 PM    <DIR>          NT SERVICE\TrustedInsta..
07/13/2009  05:54 PM         1,187,984 BUILTIN\Administrators aero-orig.msstyles

07/13/2009  05:54 PM         1,187,984 BUILTIN\Administrators aero-origWithAdmin
Ownership.msstyles
07/13/2009  05:54 PM         1,187,984 T3400-win7\steve       aero.msstyles
03/19/2010  07:52 PM         1,186,960 BUILTIN\Administrators aero1.msstyles
07/13/2009  11:37 PM    <DIR>          NT SERVICE\TrustedInstaen-US
03/19/2010  07:29 PM           216,816 BUILTIN\Administrators NORMALmoddedStc.re
s
03/19/2010  06:47 PM           216,816 BUILTIN\Administrators NORMALstc.res
07/13/2009  11:32 PM    <DIR>          NT SERVICE\TrustedInstaShell
               6 File(s)      5,184,544 bytes
               4 Dir(s)  414,667,075,584 bytes free

C:\Windows\Resources\Themes\Aero>takeown /F aero.msstyles

SUCCESS: The file (or folder): "C:\Windows\Resources\Themes\Aero\aero.msstyles"
now owned by user "T3400-win7\steve".

C:\Windows\Resources\Themes\Aero>attrib -r -s -h aero.msstyles
Access denied - C:\Windows\Resources\Themes\Aero\aero.msstyles

C:\Windows\Resources\Themes\Aero>ren aero.msstyles aero-origAfterTakeOwn.msstyle
s
Access is denied.
 

My Computer My Computer

At a glance

Windows 7 Pro x64 (dual-booting XPSP3 and Win7)Intel Core-2 Quad4GB 800 Mhz PC2 unbuffered ECCNVIDIA Quadro FX 570
Computer Manufacturer/Model Number
Dell T3400
OS
Windows 7 Pro x64 (dual-booting XPSP3 and Win7)
CPU
Intel Core-2 Quad
Memory
4GB 800 Mhz PC2 unbuffered ECC
Graphics Card(s)
NVIDIA Quadro FX 570
Sound Card
Creative SB X-Fi model SB0770
Monitor(s) Displays
Dell 19" FP
Screen Resolution
1680x1050
Hard Drives
SATA disk0 250GB disk1 500GB
Internet Speed
TW RR
Other Info
Just a baby compared to my work box!
What happens if you boot to Safe Mode then do the rename or delete?
 

My Computer My Computer

At a glance

Windows 10 Pro X64Intel Quad Core i7-4770 @ 3.4Ghz16.0GB PC3-12800 DDR3 SDRAM 1600 MHzIntel Integrated HD Graphics
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
@Raargh, I think the problem may be because the Shell is still running. Close all applications, Open your Command Prompt as Admin, then Open Task Manager and end all explorer.exe. Then run the above commands to delete/edit/replace the file. Once that is done type explorer.exe in the Command Prompt Window to re-start the shell. Or better yet reboot, with shutdown -r -f -t 0.
 

My Computer My Computer

At a glance

Windows 7 Enterprise (x64); Windows Server 20...16GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
@ztrucker - will try safe mode next.
@WindowsStar - same problem. FYI I'm using the Classic non-Aero theme while I try all of this. I also run Ivo's Classic Shell, if that helps. The problem smells as if something has a lock on the file. Is there a way to see file lock activity?

I hit the printscreen key after the last attempt. Here's the screen shot:
StillCantTouchMsstyles.jpg

One thing to keep in mind - the only reason I'm trying to mess with aero.msstyles is to be able to change background colors in Aero Themed Explorer windows. I have no desire per-se to take ownership and mess with the OS. Just trying to make backgrounds have colors of my choice. If there is an easier way I would gladly use it ...

Thanks again,

$teve
 

My Computer My Computer

At a glance

Windows 7 Pro x64 (dual-booting XPSP3 and Win7)Intel Core-2 Quad4GB 800 Mhz PC2 unbuffered ECCNVIDIA Quadro FX 570
Computer Manufacturer/Model Number
Dell T3400
OS
Windows 7 Pro x64 (dual-booting XPSP3 and Win7)
CPU
Intel Core-2 Quad
Memory
4GB 800 Mhz PC2 unbuffered ECC
Graphics Card(s)
NVIDIA Quadro FX 570
Sound Card
Creative SB X-Fi model SB0770
Monitor(s) Displays
Dell 19" FP
Screen Resolution
1680x1050
Hard Drives
SATA disk0 250GB disk1 500GB
Internet Speed
TW RR
Other Info
Just a baby compared to my work box!
Ok, I've solved the "access denied" problem.

As are most solved problems, it seems trivial in retrospect.

As I sat here fuming, I calmed down and reminded myself that although it has been many years since I passed the tests and worked much with windows, I am a W2K MCSE. I called up some of the mantra's that got me through the tests, way back in July 2001.

The problem of course, was permissions. Ownership per-se does not grant permissions. TrustedInstaller, the original owner of that and most 'system' files, has Full Control. Administrators don't. After granting Administrators Full Control, I could do what I wanted with the file. Did not solve the gross white explorer backgrounds problem, but that is a story for another thread ...
SecurityTab1.JPG
SecurityTab2.JPG
SecurityTab3.JPG


Thanks to everyone for putting up with my ranting in this thread ...

$teve
 

My Computer My Computer

At a glance

Windows 7 Pro x64 (dual-booting XPSP3 and Win7)Intel Core-2 Quad4GB 800 Mhz PC2 unbuffered ECCNVIDIA Quadro FX 570
Computer Manufacturer/Model Number
Dell T3400
OS
Windows 7 Pro x64 (dual-booting XPSP3 and Win7)
CPU
Intel Core-2 Quad
Memory
4GB 800 Mhz PC2 unbuffered ECC
Graphics Card(s)
NVIDIA Quadro FX 570
Sound Card
Creative SB X-Fi model SB0770
Monitor(s) Displays
Dell 19" FP
Screen Resolution
1680x1050
Hard Drives
SATA disk0 250GB disk1 500GB
Internet Speed
TW RR
Other Info
Just a baby compared to my work box!
Sorry $teve, I assumed you had already checked NTFS permissions and this was some other issue. Once you said it did not work with the Shell Exited I started to think about NTFS permissions. I read here that, that is what it turned out to be. I need to remember to post the simplest things first before getting deep into it. :)

So glad you got it worked out.
 

My Computer My Computer

At a glance

Windows 7 Enterprise (x64); Windows Server 20...16GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
Thank you for providing the above information. However, I keep seeing people on this forum saying they want to be the BOSS I want full control without understanding what they are doing and want to take ownership of every file and remove all others.....then 30 minutes later they are asking why their machine is crashing why it is doing weird stuff why this is not working, why they cannot install or uninstall software. Holy Cow you just took ownership of everything and the system has no access!!! Duh! You can’t uninstall or re-install or anything.

If you (anyone) really want to take ownership of every file on the machine spend the time reading "Windows 7 Resource Kit" and "Windows 7 Inside Out" cover to cover twice and then do some research on the internet for several months. This way you can be absolutely sure you know what you are doing.

I would add a disclaimer to your tutorial.

:: WARNING! Making these changes without completely understand the full effects; can or will result in requiring a complete clean reinstall of your operating system (i.e. Windows 7).

Is there directories that the SYSTEM actually has to have ownership or can you claim ownership as the ADMINISTRATOR, but still grant FULL access to the SYSTEM for that particular directory? I have on my WIN 7 machine that SYSTEM has ownership to Documents & Settings. I would think the USER would have ownership. Nonetheless, what directories does the SYSTEM need to have EXCLUSIVE OWNERSIP or is it dependent on software applications?
 
Last edited:

My Computer My Computer

At a glance

dual boot 7 & XPINTEL P4 NT2 Gb
Computer Manufacturer/Model Number
DELL OPTIPLEX GX620
OS
dual boot 7 & XP
CPU
INTEL P4 NT
Memory
2 Gb
Back
Top