Skip to content

Commit

Permalink
Fix: Fixed issue where compatibility toggle wouldn't work for some fi…
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 authored Nov 30, 2023
1 parent 847657f commit 2e6238d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,10 @@ public static bool SetCompatOptions(string filePath, string options)
{
if (string.IsNullOrEmpty(options) || options == "~")
{
return Win32API.RunPowershellCommand(@$"Remove-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' -Name '{filePath}' | Out-Null", false);
return Win32API.RunPowershellCommand(@$"Remove-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' -Name '{filePath}' | Out-Null", true);
}

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

private static ShellItem? GetFirstFile(ShellItem shi)
Expand Down

0 comments on commit 2e6238d

Please sign in to comment.