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

awilson53
  • 125
  • 1
  • 7
  • 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? – SamErde Aug 19 '10 at 17:26

1 Answers1

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.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
  • 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 00:01