码迷,mamicode.com
首页 > 系统相关 > 详细

用 PowerShell 读写注册表

时间:2015-06-02 23:32:43      阅读:510      评论:0      收藏:0      [点我收藏+]

标签:powershell   注册表   

HKEY_CURRENT_CONFIG\test\SideBySide\Winners\amd64_.netframework_31bf3856ad364e35_none_f5dd4e94975c8e4e
value=amd64.netframework31bf3856ad364e35nonef5dd4e94975c8e4efunctionResolve?Winners(value )
{
$base = “HKCU:\test\SideBySide\Winners\”

$t = dir ( $base + $value )
$t.GetType()   

<#
IsPublic IsSerial Name BaseType
——– ——– —- ——–
True False RegistryKey System.MarshalByRefObject

>

$t.Name

<#
HKEY_CURRENT_USER\test\SideBySide\Winners\amd64_.netframework_31bf3856ad364e35_none_f5dd4e94975c8e4e\6.3

>

$t.Property

<#
6.3.9600.16384
(default)

>

$t.GetValue("6.3.9600.16384")
$t.GetValue("")


$t2 = Get-Item  ( $base + $value )
$t2.GetType()
<#

IsPublic IsSerial Name BaseType
——– ——– —- ——–
True False RegistryKey System.MarshalByRefObject
#>

$t2.Name
$t2.Property
$t2.GetValue("")
$t2.SetValue("","6")
$t.GetValue("6.3.9600.16384")
$t.SetValue("6.3.9600.16384", 2, "binary" )
$key = ( $base + $value )
Get-RegistryValue $key "(default)"
Set-ItemProperty $key "(default)" "6.4"
$t2.Name
$t.Name
$t.PSChildName
Set-ItemProperty $key "(default)"  $t.PSChildName

}

用 PowerShell 读写注册表

标签:powershell   注册表   

原文地址:http://blog.csdn.net/hadstj/article/details/46335939

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!