windows – 使用powershell更改注册表二进制数据
发布时间:2021-01-28 02:14 所属栏目:52 来源:网络整理
导读:我理解使用power shell可以更改注册表值. 例如,这里:http://poshcode.org/3504 我们可以像这样设置属性: Set-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice' -name ProgId IE.FTP 但是,是否可以使用
我理解使用power shell可以更改注册表值. 例如,这里:http://poshcode.org/3504 我们可以像这样设置属性: Set-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice' -name ProgId IE.FTP 但是,是否可以使用powershell设置这些二进制值? 解决方法>读取值(字节数组)>修改数组元素 >将字节数组写回注册表项. 这是一个例子: $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 (编辑:ASP站长网) |
相关内容
网友评论
推荐文章
热点阅读