Skip to content

Commit 2e6238d

Browse files
authored
Fix: Fixed issue where compatibility toggle wouldn't work for some files (#14122)
1 parent 847657f commit 2e6238d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,10 +831,10 @@ public static bool SetCompatOptions(string filePath, string options)
831831
{
832832
if (string.IsNullOrEmpty(options) || options == "~")
833833
{
834-
return Win32API.RunPowershellCommand(@$"Remove-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' -Name '{filePath}' | Out-Null", false);
834+
return Win32API.RunPowershellCommand(@$"Remove-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' -Name '{filePath}' | Out-Null", true);
835835
}
836836

837-
return Win32API.RunPowershellCommand(@$"New-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' -Name '{filePath}' -Value '{options}' -PropertyType String -Force | Out-Null", false);
837+
return Win32API.RunPowershellCommand(@$"New-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' -Name '{filePath}' -Value '{options}' -PropertyType String -Force | Out-Null", true);
838838
}
839839

840840
private static ShellItem? GetFirstFile(ShellItem shi)

0 commit comments

Comments
 (0)