473,322 Members | 1,307 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,322 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 3220
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.