In yesterday’s post, entitled Updating Outdated Win11 Boot Media, I walked through why USB Flash Drive (UFD) boot media ages out and how to refresh same. That’s easy enough in theory, but in practice things get interesting fast. When you actually try to replace SkuSiPolicy.p7b inside a mounted WinPE, WinRE, or Windows image, Windows stops you cold. That happens, even when you’re running with elevated privileges (admin). There’s a direct collision with Win11 UFD boot file permissions, and it catches admins off guard. The culprit? Those files aren’t owned by the Administrators group at all. They’re owned by NT SERVICE\TrustedInstaller — and that’s entirely by design. That’s why using ICACLS to update UFD boot files is a must.
How Using ICACLS To Update UFD Boot Files Works
Windows Resource Protection (WRP) deliberately makes TrustedInstaller the owner of critical system files (including SkuSiPolicy.p7b)to prevent unauthorized modification, even by local Administrators. This is not a bug. It’s a carefully engineered feature. Indeed, it’s part of Windows’ layered defense-in-depth strategy. The intent is to ensure that only trusted, Microsoft-signed processes can alter these files during normal operation.
However, when we work with mounted images offline using DISM, we’re operating as the administrator of the host system. That’s no as privileged as the mounted image’s internal TrustedInstaller service. That service simply doesn’t exist in the context of an offline mount. Thus, we must temporarily take ownership of the file, make our change, and then restore TrustedInstaller ownership and permissions immediately and without exception. That leaves the file in exactly the same protected state as before. I can’t stress “temporarily” enough here. Never leave these files with altered permissions. Not even for a minute. It’s asking for trouble.
Where Does ICACLS Come In?
ICACLS stands for Integrity Control Access Control List. It is a built-in Windows command-line utility that permits users to view, modify, back up, and restore NTFS file and folder permissions (known as access control lists, or ACLs). Because TrustedInstaller owns the files we want to replace, we use ICACLS to take them over, make our change, then put things back the way they were (with TrustedInstaller back in charge).
The 7-Step Win11 UFD Boot File Permissions Cha-Cha
This is the heart of the post . Frankly, I wrote it so I could convey this info. The sequence below applies equally to files inside a mounted boot.wim (Index:1 for WinPE, Index:2 for Windows Setup), a mounted install.wim (any edition index), or a mounted WinRE.wim. Throughout, I use C:\mount\winpe\Windows\ as the example target path — substitute your own mount point and image file.
System32\SkuSiPolicy.p7b
Before you start: Open your Command Prompt or PowerShell 5.1 window as Administrator. Every single one of these commands requires elevation. Without it, you’ll get cryptic errors — or worse, silent failures that look like success until you go to unmount.
Dism /Mount-Image /ImageFile:"G:\sources\boot.wim" /Index:1 /MountDir:"C:\mount\winpe"
This mounts boot.wim Index:1 (the WinPE environment) to a local folder so the files inside become accessible to the host OS. Without mounting first, there’s nothing to edit. Substitute /Index:2 for Windows Setup. Otherwise, point/ImageFile to install.wim or WinRE.wim as your need dictate.
takeown /F "C:\mount\winpe\Windows\System32\SkuSiPolicy.p7b"
This transfers file ownership from NT SERVICE\TrustedInstaller to the currently logged-on Administrator account. Ownership transfer is the prerequisite for any ICACLS permission changes. Why? Because you cannot grant permissions on a file you don’t own. Think of it as getting the deed to the house before you start renovating.
icacls "C:\mount\winpe\Windows\System32\SkuSiPolicy.p7b" /grant Administrators:F
Even after taking ownership, the original ACL may not include explicit write access for the Administrators group. Hence, this step grants Full Control (F) explicitly. Without it, the copy command in Step 4 will fail with an unhelpful “Access Denied” error. You’ll be scratching your head wondering why ownership wasn’t enough.
copy /Y "C:\work\SkuSiPolicy.p7b" "C:\mount\winpe\Windows\System32\SkuSiPolicy.p7b"
This overwrites the old SkuSiPolicy.p7b with the updated version you extracted from a fresh MCT-generated UFD or ISO. The /Y flag suppresses the overwrite confirmation prompt. This is handy when you’re working across multiple images and don’t want to babysit the process. This is the actual update step. Everything else in this sequence exists purely to make this one command work!
icacls "C:\mount\winpe\Windows\System32\SkuSiPolicy.p7b" /setowner "NT SERVICE\TrustedInstaller"
Return ownership of the file to NT SERVICE\TrustedInstaller — immediately. This is not optional, and it is not a suggestion. Leaving Administrator as the owner breaks Windows Resource Protection and can trigger integrity check failures at boot or during servicing operations. Restore ownership the moment the copy is done.
icacls "C:\mount\winpe\Windows\System32\SkuSiPolicy.p7b" /grant:r "NT SERVICE\TrustedInstaller":F /inheritance:r
This resets the ACL to give TrustedInstaller Full Control as an explicit permission> It simultaneously removes any inherited or residual permissions left over from our earlier grant in Step 3. The /grant:r flag replaces (rather than adds to) existing grants. The /inheritance:r flag removes inheritance propagation. The intent is to match the original hardened ACL state. Together, these two flags put the security descriptor back where it belongs.
Dism /Unmount-Image /MountDir:"C:\mount\winpe" /Commit
Commits all changes and cleanly unmounts the image. Without /Commit, DISM silently discards every edit you just made. And yes, I’ve done that. (Self-deprecating aside duly noted.) If something goes sideways during any of the earlier steps, use /Discard instead to abandon all changes safely. But assuming everything went cleanly, /Commit is your finish line.
But Wait: There’s More…
Repeat this exact 7-step sequence for each image and each index you need to update — boot.wim Index:1, boot.wim Index:2, each install.wim edition index (I’ve seen up to 9 on some Windows 11 media), and WinRE.wim. Only the /MountDir path and /ImageFile path change between runs. Everything else stays the same.
A Few Gotchas Worth Watching For
- Always run elevated. Every command in this sequence requires an Administrator command prompt or PowerShell window. Failures without elevation range from cryptic error codes to silent no-ops — neither of which is helpful at 2 AM before a deployment. And remember to run Powershell.exe (version 5.1) not the PowerShell app or typical Winterm element (version 7.6.4 as I write this). DISM Mount commands work only in 5.1, as I discovered to my consternation and horror in researching this.
- Verify the copy before unmounting. Run
icacls "C:\mount\winpe\Windows\System32\SkuSiPolicy.p7b"after Step 6 — it should showNT SERVICE\TrustedInstaller:(F)as the explicit ACE. If it doesn’t, do not commit. - Don’t leave mounts open. DISM mount directories can lock up after system events, sleep cycles, or other processes touching the mount path. Get in, make your change, and unmount promptly.
- Check for stale mounts first. If DISM throws “The process cannot access the file,” run
Dism /Get-MountedImageInfoto see what’s lingering. If you find anything, clean up withDism /Cleanup-Mountpointsbefore retrying.
Wrapping Up
The seven-step sequence above is, as far as I can tell, the only safe and fully reversible way to swap WRP-protected files in offline Windows images. Furthermore, this approach isn’t limited to SkuSiPolicy.p7b — it applies to any file under Windows Resource Protection ownership. The pattern is always the same: take ownership, grant access, make the change, restore ownership, restore permissions, commit. In that order. Every time.
If you hit any edge cases I haven’t covered here — unusual mount paths, multi-edition install.wim quirks, or WinRE-specific oddities — drop a note in the comments below. I read all of them, and community answers are often better than mine. I’ll echo good stuff here as and when it shows up your comments.
I decided to document this cha-cha (it really reminds of a dance chart) because it takes time and attention to work through the sequence. It requires focus, timing and dedication. And it takes a while to learn and understand what’s going on. And, like dancing, once you get it, it’s kind of fun!
Ultimately, it also helps to explain why I recommend regenerating boot media from scratch, rather than repairing existing, outdated UFDs. Too much time and effort, too much work. I used MCT to build a new UFD in under 20 minutes yesterday. Working through this permissions stuff takes about that much time by itself, and it’s just one part of an ongoing dance doing manual UFD repair. The whole shebang took me the better part of 10 hours, spread across several days, to complete.
As I said in yesterday’s post “Don’t fix a boot media UFD unless you absolutely must.” Build a new one instead. It’s faster, easier with far fewer steps to master, including the ones I covered here to handle permissions. But for me, it was worth it, because I learned some new Windows image manipulation tricks.


