SK
когда еще в мсн-е сидели, просил посмотреть и посоветовать как лучше делать мои поделки, Вадим столько полезной информации за час мне выдал :)
Size: a a a
SK
m
VG
L
"HKEY_USERS\S-1-5-18\Environment"
Вместо ожидаемого %USERPROFILE%\AppData\Local\Temp
получаю C:\Users\MyUserName\AppData\Local\Temp
Для себя обошел проблему формируя "локальный" путь для моего профиля и сравнивая его с выводом запрашиваемого значения.Microsoft.PowerShell.Core\RegistryИз наводок нашел
[Microsoft.Win32.RegistryKey]::OpenBaseKey
[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey
$SomeUserSID = "S-1-5-18"Что это за фича такая?
$HKUTest = [Microsoft.Win32.RegistryKey]::OpenBaseKey("Users", 0)
$HKUTest.OpenSubKey( "$SomeUserSID\Environment" , $False ).GetValue("TEMP")
VB
L
%USERPROFILE%
"C:\Users\MyUserName
"A
PS > $r.GetValue('Path','', 'DoNotExpandEnvironmentNames')
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
A
PS > (New-Object -ComObject WScript.Shell).RegRead("HKEY_USERS\S-1-5-18\Environment\Path")
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
A
When the GetValue method retrieves expandable string values (RegistryValueKind.ExpandString), it expands environment strings using data from the local environment. If a value containing expandable references to environment variables has been stored as a string (RegistryValueKind.String), rather than as an expandable string (RegistryValueKind.ExpandString), GetValue does not expand it. You can expand such a string after it has been retrieved by calling the Environment.ExpandEnvironmentVariables method.
L
I
EK
VB
EK
VB
VB
VB
VG
AF