Fix virtual store snippet to use correct registry pathing

pull/19/head
Pat Hartl 2023-03-15 23:18:12 -05:00
parent e893a70fa2
commit 460f40c2cd
1 changed files with 1 additions and 1 deletions

View File

@ -1,4 +1,4 @@
$User = New-Object System.Security.Principal.NTAccount($env:UserName)
$SID = $User.Translate([System.Security.Principal.SecurityIdentifier]).value
# The OS might force your game to read/write to the user's virtual store. This will write a key to the correct SID's virtual store.
New-ItemProperty -Path "HKU:\$SID\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\<Path>" -Name "KeyName" -Value "New Value" -Force
New-ItemProperty -Path "registry::\HKEY_USERS\$SID\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\<Path>" -Name "KeyName" -Value "New Value" -Force