1

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.

Andy

1
  • 1
    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?
    – Sam Erde
    Aug 19, 2010 at 17:26

1 Answer 1

2

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

http://technet.microsoft.com/en-us/library/dd315394.aspx

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.

2
  • 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, 2010 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, 2010 at 0:01

You must log in to answer this question.

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