473,692 Members | 2,486 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Argument Exception = while deleting registry key


I'm trying to delete 1 registry key. It is giving me exception as
System.Argument Exception: 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\Micro soft\Windows\Cu rrentVersion\Un install" + "\\" +

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


2) only subKeyName


"HKEY_LOCAL_MAC HINE\\SOFTWARE\ \Microsoft\\Win dows\\CurrentVe rsion\\Uninstal l"
+ "\\" + subKeyName

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


Dec 8 '05 #1
3 3257
I guess - you want to delete 1 key & you are using "DeleteSubKeyTr ee"
Try using "DeleteSubK ey" instead


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

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


Dec 8 '05 #3
If the key does not have further keys under it (in left pane)
Registry.LocalM achine.DeleteSu bKey(@"SOFTWARE \Microsoft\Wind ows\CurrentVers ion\Uninstall\B lah");

Use DeleteSubKeyTre e, if it has further keys under it (as in


Dec 8 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: | last post by:
Some time ago I installed VC# 2003, made a small generic project, compile with the allow unsafe flag and I get the error below: "error CS1577: Assembly generation failed -- Unexpected exception processing attribute -- System.ArgumentException: Invalid directory on URL." (If I do not compile with the unsafe flag compiler setting all compiles perfect) After long tracing, I ended up discovering that it is csc.exe installed by the .NET...
by: Jesse | last post by:
Hi All, I want to be able to make an engine in VB.Net which creates a bridge between applications and the system registry, so before it's processed by the O/S, I want to be able to have the request analysed (read/write/enumerate etc.) and reject the request if it doesn't meet certain parameters. I was trying to do this in VB 6 and had a C++ Dll engine loaded in to Memory to only "buffer" the requests but it's not efficient enough. I
by: Atara | last post by:
In my apllication I use the following code: '-- My Code: Public Shared Function strDate2Date(ByVal strDate As String) As System.DateTime Dim isOk As Boolean = False If (strDate Is Nothing) Then isOk = False ElseIf Not (strDate.Length() = 6) Then isOk = False
by: Juhan | last post by:
Hi! I have a strange error in a console application that is hosted by IIS 5.0 and invokes a web service hosted on the same machine. A request form the web comes in and it is dispatched to a service class which uses a helper class to create an instance of the automatically generated webservice proxy class. The instance creation fails on this row: _10._0._40._252.ETISXTeeService srv = new
by: Harry Barker | last post by:
Hi Group I Have to complete a small project and i need you guys help in doing it. I have to create a Tool that will automatically delete a file from the Harddrive and also deleting a SubKey from the registry. Before doing the same, the tool have to check the version of Windows. Ex: For Example if you guys could suggest me a coding where i can delete
by: method | last post by:
I am trying to delete registery key encluding all its subkeys . I want to delete the bold part HKEY_CURRENT_USER, "Software\xyz\foldername\" using an api that i found on the net but i keep geting error!! could any one tell me how to delete entire key with its subkeys ? I changed : Private Sub Command3_Click()
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I have an application that pulls files, folders and registry keys of installed programs. I'm wanting to with a context menu selection of "Delete Selected", delete "ALL" of the checked selected files, folders, registry keys. Can someone show me some code to do this please?
by: =?Utf-8?B?QkJN?= | last post by:
Hi, I have an app that is crashing due to a System.ArgumentException. At this point it's just a simple app to test some basic object values. The main app is a Windows App that looks like this. Public Class DesTestForm Private Sub DesTestForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
by: ogo796 | last post by:
hi guys i have a problem here it seems like i dont get a solution.i manage to write to the text file but i want to update the existing line without writting a new line. my problem is when i want to append at the end of a line my programm write at the beginning of a next line. example 1 (2008_22)-simon; thuli ; tumi 2 (2008_23)-dude ; dan ;
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.