Windows 10: Change Owner of File, Folder, Drive, or Registry Key in Windows 10
That's ok, I just thought you meant a normal administrator account.
I found this below that you might see if the 4th post may help you with this as well.
I had the same problem trying to edit CurrentControlSet/Enum/USB. I tried all sorts of permission and ownership changes without success. I finally got it to work by using the following command
psexec -i -d -s c:\windows\regedit.exe
psexec is available from Microsoft here
This gave me full access to the registry. You should definitely be careful with this sort of access.
For me, my USB to serial device wasn't working any more. I wanted to remove the registry entries for it in Enum/USB. After deleting them with the above method, I plugged in the USB to serial adapter and it started working again. I'm running Win7 PRO.
GREAT, Brink! It finally worked. I read that thread at Technet and downloaded PsTools.
First I tried the batch file to avoid difficulties, as recommended on a post about the middle of that thread, but it gave me an error:
Couldn't install PSEXESVC service:
Access is denied.
Then, I tried the normal direct way on an elevated command prompt and Regedit opened righy away. I didn't have to use permissions and could delete that key directly from its context menu. It couldn't be easier. From what I read it would not be possible to change any security setting or delete the key with that Owner Rights entry. It was the same problem the thread starter had, even if with another key.
Thank you very much for your great and helpful advices.
That's great news Neophile. I'm glad it could help.
I installed Windows ADK 10 v1511 on Windows 10 v1511 Enterprise 64 bit.
I typed the following commands:
Now, knowing that some directories and files have the TrustedInstaller or System user as owner, what are the commands that allows to completely remove the entire content of the <Apply_Directory_Path> directory?
Dism /Apply-Image /ImageFile:"<wim_File_Path>\install.wim" /Index:1 /ApplyDir:"<Apply_Directory_Path>" /Verify /CheckIntegrity
Dism /Capture-Image /ImageFile:"<Windows_Files_Path>\sources\install.wim" /CaptureDir:"<Apply_Directory_Path>" /Name:"<Edition_name>" /Description:"<Description_name>" /Compress:max /Verify /CheckIntegrity
You could use the command from step 4 in OPTION THREE to change the owner of the directory and contents.
Afterwards, use the command from step 4 in OPTION ONE below to set permissions.
Permissions - Allow or Deny Access to Users and Groups in Windows 8
I tried this command sequence
but it does not work because the first command can not access some directories or files since this command does not have access to these directories/files or it does not find them. Why?
icacls "<Apply_Directory_Path>" /grant "Administrators":F /T /C
icacls "<Apply_Directory_Path>" /setowner "Administrators" /T /C
pushd "<Apply_Directory_Path>" && ( rd /S /Q "<Apply_Directory_Path>" 2>nul & popd )
You may need to manually take ownership of the folder or file that it cannot access instead.
Using the "Take Ownership" context menu can help make this easier.
Excuse but, from the Command Prompt, it is possible to take ownership of these directories and files gaining full control over them? If so, how do I do this?
I also noticed that, in this directory structure, there are also some symbolic links and not.
The commands you already tried were for changing the owner and permissions to take ownership. You may have to delete it and start over instead.
How Add or Remove Folders from This PC in Windows 10
The This PC window includes a Folders group that displays a linked Desktop, Documents, Downloads, Music, Pictures, and Videos folder from the current user account's "C:\Users\(user-name)"...
How to Show Hidden Files, Folders, and Drives in Windows 10
Hidden files, folders, and drives do not show by default in Windows. Windows protected system files (ex: desktop.ini files) are hidden by default. You can also manually hide a file or...
How to Add or Remove Folders on Start List in Windows 10
The Start menu in Windows 10 has a Start list that you can customize which folders appear in the list. You can add or remove the File Explorer, Settings, your Documents, your Downloads,...
I'm running VBox 5.0 on Windows 8.1 and have created VMs for Windows 7 and Windows 10 release 10240. In both VMs I have installed Visual Basic 6 (VB6).
Everything is working fine except for one strange difference. When running the Windows 7 VM, I...
I've noticed that whenever I plug in a usb thub stick or hard drive Windows 10 (Build 9879) is automatically creating empty Videos, Music, Downloads etc folders everytime.
This is quite annoying, anyone know how to turn this off?...