Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I apologize if this is listed elsewhere, but I truly couldn't find it. Does anyone know how to silently modify registry keys in Windows 7? I've tried running regedit with the /S command line switch, but it still prompts the user for permission to modify the keys before proceeding. Any help would be much appreciated.


share|improve this question
Please clarify the question. Are you trying to just run regedit without the UAC prompt, or are you pushing a .REG file to your users? – SturdyErde Aug 19 '10 at 17:26
up vote 2 down vote accepted

Since you're talking Windows 7, you will probably have better luck using a PowerShell script to handle this.

New Entry:
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion -Name PowerShellPath -PropertyType String -Value $PSHome
New Key:
New-Item -Path Registry::HKCU_DeleteMe

Microsoft makes sure that Regedit is noisy when it comes to importing registry keys. This is not true of other methods.

share|improve this answer
Didn't even think of PowerShell, can't imagine that not working for what I need to do. This is why I hang out here. Thanks guys! – awilson53 Aug 19 '10 at 17:36
Powershell should be fail at this command unless you run powershell in an elevated command prompt. The message should be "New-ItemProperty : Requested registry access is not allowed" – Jim B Aug 20 '10 at 0:01

Your Answer


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.