Powershell 插入不带引号的默认注册表名称
Powershell insert default registry name without quotes
我正在尝试使用 Powershell 在上下文菜单中添加一个应用程序。
当我使用下面的命令添加注册表可扩展字符串时,名称 Default aka @ 插入在引号之间,但它应该没有。
[Microsoft.Win32.Registry]::SetValue("$hcrAPP\shell$flyout\command", "@", "$appPath$appVer\app\bin\app.exe $userDir$app", Microsoft.Win32.RegistryValueKind]::ExpandString)
结果:
"@"=hex(2):43,00,3a,...
预期结果:
@=hex(2):43,00,3a,...
Note
A registry key can have one value that is not associated with any
name. When this unnamed value is displayed in the registry editor, the
string "(Default)" appears instead of a name. To set this unnamed
value, specify either null or the empty string ("") for name.
我正在尝试使用 Powershell 在上下文菜单中添加一个应用程序。 当我使用下面的命令添加注册表可扩展字符串时,名称 Default aka @ 插入在引号之间,但它应该没有。
[Microsoft.Win32.Registry]::SetValue("$hcrAPP\shell$flyout\command", "@", "$appPath$appVer\app\bin\app.exe $userDir$app", Microsoft.Win32.RegistryValueKind]::ExpandString)
结果:
"@"=hex(2):43,00,3a,...
预期结果:
@=hex(2):43,00,3a,...
Note
A registry key can have one value that is not associated with any name. When this unnamed value is displayed in the registry editor, the string "(Default)" appears instead of a name. To set this unnamed value, specify either null or the empty string ("") for name.