I currently have:
(SET _KEY=C:\Windows\SystemApps)
%~d0\Batch\SetACL.exe -on "%_KEY%" -ot file -actn ace -ace "n:%username%;p:full
%~d0\Batch\SetACL.exe -on "%_KEY%" -ot file -actn ace -actn -clr "n:SYSTEM;p:full
%~d0\Batch\SetACL.exe -on "%_KEY%" -ot file -actn ace -ace "n:SYSTEM;p:full
It does nothing for this file:
C:\Windows\SystemApps\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\core\js\appLaunchers\WindowsCoreLocalAccountCreator.js
This is the current permissions:
I need to change the permissions so i can delete the file. I'm running in Windows 10. My user has administrator rights.
How to replace permissions with Setacl
Moderator: DosItHelp
Re: How to replace permissions with Setacl
If, as seen in your GUI screenshot, the only user who has the necessary permissions to modify, (nevermind delete), this, is the current owner, TrustedInstaller. For that reason, my assumption is that only TrustedInstaller can modify the permissions, you can clearly see that SYSTEM and Administrators, and Users cannot, (they can only read and execute).
Please review the methodology here.
Please review the methodology here.
Re: How to replace permissions with Setacl
Thank you for the manual instructions.
I have a couple hundred files like this that I need to delete for Corel Wordperfect. I'd like to figure out how to do it in a bat file. I'm currently having trouble installing the latest version of Wordperfect. If I have this in a bat file, I can remove all the old versions on all the computers and clean it up to put the new version on.
Can you suggest how to replace the owner with SetACL.exe?
I have a couple hundred files like this that I need to delete for Corel Wordperfect. I'd like to figure out how to do it in a bat file. I'm currently having trouble installing the latest version of Wordperfect. If I have this in a bat file, I can remove all the old versions on all the computers and clean it up to put the new version on.
Can you suggest how to replace the owner with SetACL.exe?
Re: How to replace permissions with Setacl
I figured out how to do it. This allows me to delete the file.
Code: Select all
Set "Key=C:\Windows\SystemApps\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\core\js\appLaunchers\WindowsCoreLocalAccountCreator.js"
%~d0\Batch\setacl -on "%Key%" -ot file -actn setowner -ownr "n:%username%"
%~d0\Batch\SetACL -on "%Key%" -ot file -actn trustee -trst n1:System;ta:remtrst;w:dacl
%~d0\Batch\SetACL -on "%Key%" -ot file -actn trustee -trst n1:"ALL APPLICATION PACKAGES";ta:remtrst;w:dacl
%~d0\Batch\SetACL -on "%Key%" -ot file -actn trustee -trst n1:"ALL RESTRICTED APPLICATION PACKAGES";ta:remtrst;w:dacl
%~d0\Batch\SetACL -on "%Key%" -ot file -actn trustee -trst n1:Administrators;ta:remtrst;w:dacl
%~d0\Batch\SetACL -on "%Key%" -ot file -actn trustee -trst n1:Users;ta:remtrst;w:dacl
%~d0\Batch\SetACL -on "%KEY%" -ot file -actn ace -ace "n:%username%;p:full"