REGEDIT: Delete Current User keys with a little more ease
I'm terrible with traversing alphabetic directories; when I was in high school and I took the series of military aptitude tests, that was the only one I didn't do well on. I excelled at the rest and the military did their best to court me. All I can say is that I'm one of the many potential recruits that they lost because of their dumb Don't Ask, Don't Tell policy. The recruiter told me they would overlook it but living the closeted life is not how I roll. Where am I going with this? Well, the Windows registry is a quadruple nightmare for me (and I'm sure a lot of others.) Any time I'm required to do something in it, I always try to automate the process. When anyone at my company is required to modify something in the registry at more than one workstation, I try to automate the process for them too.
Recently, after an NT to 2k3 domain migration, we had some old legacy keys that were causing problems; applications set in startup were opening twice. Unfortunately, they were under the HKCU (current user) key which is not available via Remote Registry or REG DELETE \machineName. Oh well, at least I could make a batch file for the Help Desk to double click while sitting at the user's desk. We needed to delete keys valued 1 and 2 under the HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run key so we create a batch file which ran the following: REG DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run /f /v 1 REG DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run /f /v 2Alternatively, if we would have watned to delete everything under that Run key, we could have used the /va switch instead.
REG DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run /f /va