Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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...}
share|improve this question

2 Answers 2

up vote 3 down vote accepted

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))
share|improve this answer

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

share|improve this answer
    
The key is set already but has a different value. –  Prashanth Sundaram Nov 11 '11 at 17:06
1  
if the key exists remove the -propertytype parameter –  Jim B Nov 11 '11 at 17:10
    
That worked THANKS!! –  Prashanth Sundaram Nov 11 '11 at 17:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.