471,570 Members | 947 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

System.ArgumentException = while deleting registry key

Hi

I'm trying to delete 1 registry key. It is giving me exception as
System.ArgumentException: Cannot delete a subkey tree because the
subkey does not exist.

For deleting subkey, how to provide the key name?

For e.g.

1) "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninsta ll" + "\\" +
subKeyName

Here "subKeyName" implies the software that is to be deleted.

OR

2) only subKeyName

OR

3)
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\ \CurrentVersion\\Uninstall"
+ "\\" + subKeyName

Any help / clue will be very much helpful.
Thanks in advance.

Regards
Asawari

Dec 8 '05 #1
3 3154
I guess - you want to delete 1 key & you are using "DeleteSubKeyTree"
Try using "DeleteSubKey" instead

HTH
Kalpesh

Dec 8 '05 #2
No.
i'm using DeleteSubKey method only.

Inspite of using this method, it's giving this exception.

Regards
Asawari

Dec 8 '05 #3
If the key does not have further keys under it (in left pane)
Registry.LocalMachine.DeleteSubKey(@"SOFTWARE\Micr osoft\Windows\CurrentVersion\Uninstall\Blah");

Use DeleteSubKeyTree, if it has further keys under it (as in
sub-folders)

HTH
Kalpesh

Dec 8 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Jesse | last post: by
7 posts views Thread by eSolTec, Inc. 501(c)(3) | last post: by
6 posts views Thread by =?Utf-8?B?QkJN?= | last post: by
1 post views Thread by ogo796 | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.