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?

link|improve this question

43% accept rate
feedback

2 Answers

up vote 4 down vote accepted

reg delete HKLM\MyTree should do it.

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

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.