5

我了解使用 powershell 可以更改注册表值。

例如,这里: http: //poshcode.org/3504

我们可以像这样设置属性:

Set-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice' -name ProgId IE.FTP

但是,是否可以使用 powershell 设置这些二进制值?

在此处输入图像描述

4

1 回答 1

12
  1. 读取值(字节数组)
  2. 修改数组元素
  3. 将字节数组写回注册表项。

这是一个例子:

$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections'

$data = (Get-ItemProperty -Path $key -Name DefaultConnectionSettings).DefaultConnectionSettings
$data[8] = 9
Set-ItemProperty -Path $key -Name DefaultConnectionSettings -Value $data
于 2013-04-09T23:41:15.517 回答