Open Powershell as administrator copy and paste: $username = $env:USERNAME $folderPath = "C:\Users\$username\AppData\Local\Packages\microsoft.windowscommunicationsapps_8wekyb3d8bbwe\LocalState\Migration" $fileToDelete = "$folderPath\settings.json" if (Test-Path -Path $fileToDelete) { Remove-Item -Path $fileToDelete -Force Write-Host "File $fileToDelete has been deleted." } else { Write-Host "File $fileToDelete does not exist." } $currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name $acl = Get-Acl -Path $folderPath $denyWriteRule = New-Object System.Security.AccessControl.FileSystemAccessRule($currentUser, "Write", "Deny") $acl.AddAccessRule($denyWriteRule) Set-Acl -Path $folderPath -AclObject $acl Write-Host "Write access denied for $currentUser on $folderPath"