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.

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

2 Answers 2

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):

REGEDIT4

[-HKEY_LOCAL_MACHINE\MyTree]

(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

 
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.