加入收藏 | 设为首页 | 会员中心 | 我要投稿 辽源站长网 (https://www.0437zz.com/)- 云专线、云连接、智能数据、边缘计算、数据安全!
当前位置: 首页 > 服务器 > 系统 > 正文

windows – 使用powershell更改注册表二进制数据

发布时间:2021-02-02 07:17:47 所属栏目:系统 来源:网络整理
导读:我理解使用power shell可以更改注册表值. 例如,这里:http://poshcode.org/3504 我们可以像这样设置属性: Set-ItemProperty 'HKCU:SoftwareMicrosoftWindowsShellAssociationsUrlAssociationsftpUserChoice' -name ProgId IE.FTP 但是,是否可以使用

我理解使用power shell可以更改注册表值.

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

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

Set-ItemProperty 'HKCU:SoftwareMicrosoftWindowsShellAssociationsUrlAssociationsftpUserChoice' -name ProgId IE.FTP

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

解决方法

>读取值(字节数组)
>修改数组元素
>将字节数组写回注册表项.

这是一个例子:

$key = 'HKCU:SoftwareMicrosoftWindowsCurrentVersionInternet SettingsConnections'

$data = (Get-ItemProperty -Path $key -Name DefaultConnectionSettings).DefaultConnectionSettings
$data[8] = 9
Set-ItemProperty -Path $key -Name DefaultConnectionSettings -Value $data

(编辑:辽源站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读