3

I am trying to deploy a custom registry entry which I exported from a test machine. It looks like below. I came across THIS similar request on another site, but I couldn't make it to work.

"TextFontSimple"=hex:3c,00,00,00,1f,00,00,f8,00,00,00,40,dc,00,00,00,00,00,00,\ 00,00,00,00,ff,00,31,43,6f,75,72,69,65,72,20,4e,65,77,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

As per the other solution, my PS command below, throws error."A parameter cannot be found that matches parameter name"

Set-ItemProperty -Path "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\MailSettings" -Name "TextFontSimple" -PropertyType Binary -Value ([byte[]] (0x3c,0x00,0x00,0x00,0x1f....0x00))

Any ideas?

====EDIT=====

The key & value already exists. When I use Get-ItemProperty

PSPath         : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\MailSettings
PSParentPath   : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common
PSChildName    : MailSettings
PSProvider     : Microsoft.PowerShell.Core\Registry
TextFontSimple : {60, 0, 0, 0...}

2 Answers 2

3

To figure out what went wrong with the direct registry setting approach, you'll need to provide more information about what you attempted and what went wrong.

For the powershell approach, you seem to be confusing New-ItemProperty and Set-ItemProperty. When creating a new value, you can set the type. When modifying an existing value, you cannot; this is true of all methods of modifying the Windows registry, and it's the reason that your -PropertyType parameter is causing the command to error.

If the value already exists, but isn't set right:

Set-ItemProperty -path HKCU:\Software\Microsoft\Office\14.0\Common\MailSettings -name TextFontSimple -value ([byte[]] (0x3c,0x68,0x74,0x6d....0x00))

If it doesn't exist:

New-ItemProperty -path HKCU:\Software\Microsoft\Office\14.0\Common\MailSettings -name TextFontSimple -propertytype Binary -value ([byte[]] (0x3c,0x68,0x74,0x6d....0x00))
0
1

More than likely the key you are trying to set doesn't exist yet. Try using new-itemproperty instead of set-itemproperty

2
  • The key is set already but has a different value. Nov 11, 2011 at 17:06
  • 1
    if the key exists remove the -propertytype parameter
    – Jim B
    Nov 11, 2011 at 17:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .