windows – 使用powershell更改注册表二进制数据
发布时间:2021-01-29 04:43:03 所属栏目:系统 来源:网络整理
导读:我理解使用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 (编辑:青岛站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |