Nim*_*jox 1 registry powershell registrykey
我正在尝试使用powershell添加/编辑注册表项:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment Name:Station Value:2 Type:String
我试图这样做:
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" -Name "Station" -ItemType "String -Value "2" -force
Run Code Online (Sandbox Code Playgroud)
但是,这只是在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet001\Control\Session Manager\Environment下创建一个名为"Station"的子文件夹,其名称为:"default",值为:"2"
我不明白为什么它在001 CCS选项卡中输入密钥,以及为什么它将其作为子文件夹而不是密钥名称.我在这里想念的是什么
使用注册表提供程序时,"Items"对应于KEYS(即"folders"),而"Item Properties"对应于VALUES.所以你想使用New-ItemPropertycmdlet.
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' -Name 'Station' -Value '2' -PropertyType 'string'
Run Code Online (Sandbox Code Playgroud)
您可以通过运行查看注册表提供程序的完整文档Get-Help Registry.
| 归档时间: |
|
| 查看次数: |
210 次 |
| 最近记录: |