Changing / creating reg values

Copper Contributor

Hi all,

 

I am new to PowerShell and I am writing scripts to check and configure some security settings of MS Office.

 

I have managed to write the following, but it gives me an error when trying to create a hierarchy of a registry key. If I use -Force it will overwrite the existing data in a key, which I aim to avoid.

 

Looking forward to hearing from you.

1 Reply
Hi Svetzolar, try to use cmd command instead powershell
reg add $path /v $regname /t REG_DWORD /d 1 /f

maybe it will work.
Thank you very much
Regards