473,408 Members | 2,450 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to registry key

Hi,

I'd like to know how to remove registry keys which contain a value of
'appkeyA' or
'appkeyB' or
'appkeyC' ...?

thanks in advance
Nov 21 '05 #1
12 3227
Do you mean recursively searching the registry looking for those keys or are
they under a certain path? Are there any subkeys to those keys?

Awaiting your response

"Li Pang" wrote:
Hi,

I'd like to know how to remove registry keys which contain a value of
'appkeyA' or
'appkeyB' or
'appkeyC' ...?

thanks in advance

Nov 21 '05 #2
"Li Pang" <Li****@discussions.microsoft.com> schrieb:
I'd like to know how to remove registry keys which contain a value of
'appkeyA' or
'appkeyB' or
'appkeyC' ...?


Take a look at the 'Microsoft.Win32.Registry' class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
Looking at the Registry Key class will only help in some instances. What if
the user is looking for a recursive seach & then delete answer to his/her
question then your reply hasn't helped at all?

"Herfried K. Wagner [MVP]" wrote:
"Li Pang" <Li****@discussions.microsoft.com> schrieb:
I'd like to know how to remove registry keys which contain a value of
'appkeyA' or
'appkeyB' or
'appkeyC' ...?


Take a look at the 'Microsoft.Win32.Registry' class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
It is a recursive seach, through whole database or from a node.

"Crouchie1998" wrote:
Looking at the Registry Key class will only help in some instances. What if
the user is looking for a recursive seach & then delete answer to his/her
question then your reply hasn't helped at all?

"Herfried K. Wagner [MVP]" wrote:
"Li Pang" <Li****@discussions.microsoft.com> schrieb:
I'd like to know how to remove registry keys which contain a value of
'appkeyA' or
'appkeyB' or
'appkeyC' ...?


Take a look at the 'Microsoft.Win32.Registry' class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5
Crouchie,

"Crouchie1998" <Cr**********@discussions.microsoft.com> schrieb:
Looking at the Registry Key class will only help in some instances. What
if
the user is looking for a recursive seach & then delete answer to his/her
question then your reply hasn't helped at all?


Well, who knows if the OP is able to implement a recursive search? I don't
know, and thus I don't spend the time to write a complete solution if the OP
is able to do that himself. If the OP has problems to do that, and asks how
to do that, I'll maybe spend this time.

Just my 2 Euro cents...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6
I wrote a recursive registry search function around 4 months ago, but that
only lists the results in a listview. However, its on a CD I have created for
sale & don't want the code to be posted here because it seems that I am the
first person to do this in VB.NET, as there isn't anything on the Internet
about it. Its not complicated code though, but that's my opinion.

Sorry, but I am not prepared to compromise future sales of my CD to answer
this question. I made the mistake of uploading a shutdown/restart/logoff/lock
solution in VB.NET & now everyone has copied my code.

"Herfried K. Wagner [MVP]" wrote:
Crouchie,

"Crouchie1998" <Cr**********@discussions.microsoft.com> schrieb:
Looking at the Registry Key class will only help in some instances. What
if
the user is looking for a recursive seach & then delete answer to his/her
question then your reply hasn't helped at all?


Well, who knows if the OP is able to implement a recursive search? I don't
know, and thus I don't spend the time to write a complete solution if the OP
is able to do that himself. If the OP has problems to do that, and asks how
to do that, I'll maybe spend this time.

Just my 2 Euro cents...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #7

First, if your post really is just saying "I know how to do it but I'm
not sharing", which is how I'm reading it, then what are you doing
here? If that's your attitude about learing to write software and
helping others then you don't belong here.

Second, you can't really sell code that is so generic and easily
reproducible that it's a basic concept anyone working with the
registry in .net can do (see below).

Good bye,

Sam
Imports Microsoft.Win32

Public Class RegSearch

Public Shared Sub Search(ByVal text As String)
For Each key As RegistryKey In New RegistryKey() { _
Registry.ClassesRoot, _
Registry.CurrentConfig, _
Registry.CurrentUser, _
Registry.LocalMachine, _
Registry.Users _
}
SearchKey(text, key)
Next

Console.WriteLine("Done")
End Sub
Private Shared Sub SearchKey(ByVal text As String, ByVal key As
RegistryKey)

If key Is Nothing Then
Return
End If

If key.Name.IndexOf(text) > -1 Then
Console.WriteLine("Found in " + key.ToString())
End If

For Each valueName As String In key.GetValueNames()
If valueName.IndexOf(text) > -1 Then
Console.WriteLine("Found in " + key.ToString() + ", " +
valueName)
End If

Dim value As Object = key.GetValue(valueName)
If Not value Is Nothing AndAlso _
value.ToString().IndexOf(text) > -1 Then
Console.WriteLine("Found in " + key.ToString() + ", " +
valueName + ": " + value.ToString())
End If
Next

For Each subKeyName As String In key.GetSubKeyNames()
Try
SearchKey(text, key.OpenSubKey(subKeyName))
Catch ex As Security.SecurityException
' can't search this one, just skip it
End Try
Next
End Sub

End Class


On Wed, 2 Feb 2005 10:21:06 -0800, Crouchie1998
<Cr**********@discussions.microsoft.com> wrote:
I wrote a recursive registry search function around 4 months ago, but that
only lists the results in a listview. However, its on a CD I have created for
sale & don't want the code to be posted here because it seems that I am the
first person to do this in VB.NET, as there isn't anything on the Internet
about it. Its not complicated code though, but that's my opinion.

Sorry, but I am not prepared to compromise future sales of my CD to answer
this question. I made the mistake of uploading a shutdown/restart/logoff/lock
solution in VB.NET & now everyone has copied my code.

Nov 21 '05 #8
If you see my first post to this thread you will see that I asked the user if
he/she wanted to delete a certain key or recursively search.

So, what you are telling me is that if I write code/programs that are 100%
of my work then I cannot copyright the code/program? So, what you are saying
is that no program ever written should be sold. GIVE ME A BREAK.

Take the VB.NET/C# convertors for example: If you download the VB.NET
Resource Kit then it is included FREE, but others have create simular
programs & sell them for $200. Are you saying they shouldn't sell them?

The CD I have created to sell is 100% my own work. There are language
tutorials, sample applications as well as demo applications because I want to
keep the source code for that.

Anyway, I have 9 tutorial/applications on the Internet for download
including full source code.

I don't mind coding certain solutions for people at all, but my recursive
search registry is an application. Would you go to a software house and ask
them for the source code because you don't know how to do it? You know they
wouldn't give it to you.

Nov 21 '05 #9

Of course not. But I also wouldn't expect someone from a commercial
vendor to respond to a question on how to do something by saying "we
do it in our software" and not sharing how.

If you don't want to share your code, fine, that's your right. If you
want to try to sell it, fine, that's your right. But posting a
response here saying basically "I know how to do it but I'm not
tellin', nah nah nah" is not really appropriate.

Sam
On Wed, 2 Feb 2005 12:05:02 -0800, Crouchie1998
<Cr**********@discussions.microsoft.com> wrote:
I don't mind coding certain solutions for people at all, but my recursive
search registry is an application. Would you go to a software house and ask
them for the source code because you don't know how to do it? You know they
wouldn't give it to you.


Nov 21 '05 #10
I code around 18 hours a day & help people in many different forums & have
done for around 7 years (or just over). Some code has to be kept to oneself,
but 98% of my code I share or code especially for the people asking the
questions.

If the original user of this thread wanted to just delete a key then I would
have been happy to give a solution, but when it requires something that took
me a lot of hassle then I decline. A lot of frustration went into the program
I am talking about & I almost give it up.

"Samuel R. Neff" wrote:

Of course not. But I also wouldn't expect someone from a commercial
vendor to respond to a question on how to do something by saying "we
do it in our software" and not sharing how.

If you don't want to share your code, fine, that's your right. If you
want to try to sell it, fine, that's your right. But posting a
response here saying basically "I know how to do it but I'm not
tellin', nah nah nah" is not really appropriate.

Sam
On Wed, 2 Feb 2005 12:05:02 -0800, Crouchie1998
<Cr**********@discussions.microsoft.com> wrote:
I don't mind coding certain solutions for people at all, but my recursive
search registry is an application. Would you go to a software house and ask
them for the source code because you don't know how to do it? You know they
wouldn't give it to you.


Nov 21 '05 #11
Crouchie,

"Crouchie1998" <Cr**********@discussions.microsoft.com> schrieb:
If the original user of this thread wanted to just delete a key then I
would
have been happy to give a solution, but when it requires something that
took
me a lot of hassle then I decline. A lot of frustration went into the
program
I am talking about & I almost give it up.


So, wouldn't it be great if you could prevent somebody from getting as
frustrated as you were? I understand that it's not right to post code from
commercial projects here if the client you wrote the application for doesn't
want you to do that. Nevertheless, there is always the option of modifying
the code, removing parts not being relevant for the reply, and posting this
strongly adapted code.

Just my thoughts...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #12
Crouchie1998,

If you couldn't post your codes, I appreciate if you can provide some ideals
about how to do such tasks. Acturally, we can't do any business within this
newsgroup. I believe you are an expert and might be the first person to do
such job, but certainly not the last one. Writting the below email instead of
give a help can't give any benefice to nobody and is useless.

"Crouchie1998" wrote:
I wrote a recursive registry search function around 4 months ago, but that
only lists the results in a listview. However, its on a CD I have created for
sale & don't want the code to be posted here because it seems that I am the
first person to do this in VB.NET, as there isn't anything on the Internet
about it. Its not complicated code though, but that's my opinion.

Sorry, but I am not prepared to compromise future sales of my CD to answer
this question. I made the mistake of uploading a shutdown/restart/logoff/lock
solution in VB.NET & now everyone has copied my code.

"Herfried K. Wagner [MVP]" wrote:
Crouchie,

"Crouchie1998" <Cr**********@discussions.microsoft.com> schrieb:
Looking at the Registry Key class will only help in some instances. What
if
the user is looking for a recursive seach & then delete answer to his/her
question then your reply hasn't helped at all?


Well, who knows if the OP is able to implement a recursive search? I don't
know, and thus I don't spend the time to write a complete solution if the OP
is able to do that himself. If the OP has problems to do that, and asks how
to do that, I'll maybe spend this time.

Just my 2 Euro cents...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #13

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

Similar topics

3
by: Rohit Santhanam | last post by:
As I am reading the .NET documentation, I get the feeling that Microsoft is trying to get rid of the registry. My understanding is that an application built using .NET does not use the registry...
0
by: vincemoon | last post by:
Below is an excerpt from my Registry Log, created by Redmon, showing the process whereby TweakUI added the compressed folder option to the new sub-menu in the right click context menu for open...
1
by: rdavis7408 | last post by:
I have a database that has a form that opens a report using date parameters. I have been using it for six months and last week I began to get the following Error Message: "File sharing lock...
8
by: Al Kaufman | last post by:
I have a simple console app that uses: regSubKey = <some registry key> Dim reg As RegistryKey = Registry.ClassesRoot.OpenSubKey(regSubKey) Dim path As String path = CStr(reg.GetValue(""))
4
by: Bob | last post by:
My question about how to add an assembly search path to VS.NET's IDE remains unanswered, but I'm still faced with a problem possibly associated with this: my exported registry is more than 67MB....
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to create a registry key, but orphan it from the program that created it? Reason: Create a key, but not associate it with the...
3
by: Aussie Rules | last post by:
Hi, I want to store some data in the registry, however I have not been able to do this, and think my logic maybe flawed. Firstly I try to open the registry and read in any existing values....
6
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.