Super User is a question and answer site for computer enthusiasts and power users. 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 am have imported .reg file to registry using command line utility (as admin).

regedit /s myregfile.reg

To remove MyTree I have used following command but it does not work.

regedit [-HKEY_LOCAL_MACHINE\MyTree] // suppose to remove MyTree

Can anybody suggest me solution to it?

share|improve this question
up vote 4 down vote accepted

reg delete HKLM\MyTree should do it.

share|improve this answer
Thanks it worked . – ashish Jan 8 '10 at 10:45

To add to the answer:

regedit, when in import mode, always takes a file name. So giving it "[-HKLM\MyTree]" will not work unless you happen to have a valid Registry file named that. So you would need to create a temporary file and import it (unfortunately, there's no direct equivalent to /dev/stdin in Windows), like a file with the following contents (always a blank line after the first):



(Using the reg command is a lot better. But this may be helpful for when it's not available.)

share|improve this answer

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.