Package Information

Get-AppxPackage > AppDetails.txt

Starting “Store App” from CMD

Change Owner

Using CLI

To use takeown the user has to have “Take Ownership” permission.

# Change Owner to current user
takeown /f "C:\Program Files\WindowsApps" /r
 
# Change Owner to a different user
icacls "C:\Program Files\WindowsApps" /setowner "DOM\user" /t /l

Using GUI

Right-click Folder → Properties → Security → Advanced

Use the Change button beside the Owner
Enter the name of the user and click on Check Name

Permissions

View Permissions

icacls: Identity Control Access Control List(s)

icacls "C:\Users"
CodePermission
FFull Control
MModify
RXRead & Execute
RRead
WWrite

By default the permissions are inherited by the children objects

CodeNameDescription
IInheritancePermission received from parent
OIObject InheritanceFile will inherit permissions
CIContainer InheritanceFolder will inherit permissions

Change Permissions

icacls C:\foo /grant "DOM\user:(OI)(CI)(F)"
icacls C:\foo /grant "DOM\user:(OI)(CI)(R,WO)"

/remove can be used to remove permission

icacls | Microsoft Learn

Attributes

View Attributes

# List all objects (including Hidden)
Get-ChildItem "C:\path\to\folder" -Force
 
# Object Attributes
Get-Item "C:\path\to\file" | Format-List Attributes
(Get-Item "C:\path\to\file").Attributes

-Hidden: List hidden objects only

CharacterMeaning
dDirectory
aArchive (file is flagged for backup or archiving)
rRead-only (cannot be modified easily)
hHidden (not shown in Explorer by default)
sSystem (used by the OS, often protected)

All normal files will have the a flag set. All objects have at least one attribute.
The s flag will make a file protected, the file will be hidden in Explorer.

Change Attributes

# Add attributes
Set-ItemProperty -Path "C:\path\to\file" `
	-Name Attributes -Value "Hidden, ReadOnly"
 
# Reset attributes
Set-ItemProperty -Path "C:\path\to\file" -Name Attributes -Value Normal
 
# Remove Attributes
(Get-Item "C:\path\to\file").Attributes -= "Hidden, System"
AttributeDescription
ReadOnlyPrevents a file from being modified.
HiddenHides the file from standard directory listings.
SystemMarks the file as a system file, used by the OS.
ArchiveIndicates the file has been modified since the last backup.
NormalReset object attributes.

FileAttributes Enum (System.IO) | Microsoft Learn

# Works with CMD
attrib +h "C:\path\to\file.ico"
attrib -h -s "C:\path\to\file.ico"

attrib | Microsoft Learn