Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So the problem is im trying to delete some reqistry keys (startup items) via commandline and while i can delete from HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run just fine i cannot delete anything from HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

I even created some temporary keys there trough regedit.exe but even those are undeletable via commandline. So i searched trough similar threads here and obviously googled it. Usually this happens because:

  1. Command promt is not run as administrator. Thats not the case here as i defenetly have administrator rights within the launched cmd window.
  2. Registry permissions are blocking deletion. Again not the case here. I manually changed permission trough regedit.exe and om now the owner of HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run along with full control for my aacount.

The specific error message given by commandline is:

ERROR: The system was unable to find the specified registry key or value.

Yet the key defenetly exists in the location where im trying to delete it from and even regedit shows its there. I can also delete it with regedit without a problem.

Anyone have any clues as what to check?

EDIT: Ok so while writing this post i stumbled upon something really bizarre. It would appear that there are two versions of HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

I have no idea hows this even possible but when i copy the key name in regedit they are both identical and yet they display different items. The first one is ok and it seems reg.exe is trying to find and delete the key in this location and thats why it errors out. The second one is the problematic one where the key exists that i need to delete via commandline.

However when i add an identical key to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run it gets written to the "correct" location and i can also delete it via commandline.

EDIT 2: Ok ithink i know what the problem is now. The "correct" location is displayed when i ren native 64bit version of regedit and the problematic one is only displayed when i run 32bit version of regedit.

SOLUTION: Use %windir%\SysWOW64\reg.exe to manipulate 32bit registry entries and %windir%\System32\reg.exe to manipulate 64bit registry entries. Im going to have a stern talk with the program authors tho about why they shove their startup key into 32bit reqistry on a 64bit system.

So...yeah. No help needed but i figure i might as well post this anyway. It could help someone save alot of trouble in the future.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

SOLUTION: Use %windir%\SysWOW64\reg.exe to manipulate 32bit registry entries and %windir%\System32\reg.exe to manipulate 64bit registry entries. Im going to have a stern talk with the program authors tho about why they shove their startup key into 32bit reqistry on a 64bit system.

So...yeah. No help needed but i figure i might as well post this anyway. It could help someone save alot of trouble in the future.

share|improve this answer
    
If the setup program is 32 bit, the Registry entries it creates would be redirected to the Wow6432Node key automatically. –  David Marshall Jul 29 '13 at 17:48
    
The setup and program itself are 64bit. I notified the program author but it seems in newer beta versions the startup key is obsolete anyway and task scheduler is used instead. The program in question is hwinfo64 –  TMRW Jul 29 '13 at 19:41

Your Answer

 
discard

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.