How to update #commented existing registry value

Hi,

I have registry property Unicode without value for that property:

Get-ItemProperty -Path “HKLM:\Software\PCTAIL”

#Unicode

If I set this registry value:

Set-ItemProperty -Path “HKLM:\Software\PCTAIL” -Name Unicode -Value 1

And then again do get command:

Get-ItemProperty -Path “HKLM:\Software\PCTAIL”

Unfortunately I see two values!

#Unicode

Unicode 1

But actually I would need only second one.

I think only the best approach is to UPDATE already existing row (without deletion) if this is possible somehow and not to create two duplicate rows…

How this can be resolved succesfully? Why I am getting two duplicated rows?

Thanks in advance

 

This might help you to work with registry values:

https://docs.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-entries?view=powershell-7

To read the value you have written you have specify what property you’d like to read

(Get-ItemProperty -Path “HKLM:\Software\PCTAIL” -Name Unicode).Unicode

Hi,

 

thanks but unfortunately this does not resolve my issue. I already know how to create new value and how to read value. But I do not know how to just update existing #commented row.

Does anyone may help with this one?

Thanks in advance!!!

[quote quote=212826] But I do not know how to just update existing #commented row.

Does anyone may help with this one?[/quote]

I have never heard of something like a #commented row in my last 20 years in the IT industry. Either you’re not using the right name or you discovered something completely new. :wink: To set an existing property value you use Set-ItemProperty.

Thanks,

it seems that solution for my problem was combination of

Rename-Item

and after it

Set-Item.

Thanks for assistance.