473,625 Members | 3,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating Data field of Value in Registry

LCD
Here is what I want to do:

Presently in my registry I have:

(Default) = "C:\Program Files\myApp" and this value is scattered all over
registry in several keys and subkeys.

I wouldlike to have write a small c# app that will search the Data file
"C:\Program Files\myApp" and replace it with "E:\Data\myApp" . In regedit one
can search for a certain data, but you can't do "Replace All" with a certain
data type, hence this quest for writing and learning to interact with
Registry.

I have written apps in the past to read specific registry values, but
nothing generic of this nature. Can someone point me and advise me on how to
do this. Any and all help is greatly appreciated.

Regards, LCD
Nov 17 '05 #1
2 2069
LCD,

This is a function you will have to perform manually. Unless you are
writing a general-purpose app to do this, I wouldn't recommend doing this.
It is possible that there are other registry keys in your system that have
this value in it which should not be replaced.

If you wanted to do this, you would basically have to iterate through
all of the keys recursively (your implementation shouldn't be recursive, but
the operation is a recursive one, to say the least). You would open the
registry key for the root nodes (maybe not all of them, because some of them
are really references to nodes in other trees), and check to replace your
value (through a call to GetValueNames and GetValue).

Then, you would call GetSubKeyNames to get the names of all the sub keys
of the current registry key, and perform the same operation on them.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"LCD" <LC*@discussion s.microsoft.com > wrote in message
news:17******** *************** ***********@mic rosoft.com...
Here is what I want to do:

Presently in my registry I have:

(Default) = "C:\Program Files\myApp" and this value is scattered all over
registry in several keys and subkeys.

I wouldlike to have write a small c# app that will search the Data file
"C:\Program Files\myApp" and replace it with "E:\Data\myApp" . In regedit
one
can search for a certain data, but you can't do "Replace All" with a
certain
data type, hence this quest for writing and learning to interact with
Registry.

I have written apps in the past to read specific registry values, but
nothing generic of this nature. Can someone point me and advise me on how
to
do this. Any and all help is greatly appreciated.

Regards, LCD

Nov 17 '05 #2
On Nov 10th Willy Denoyette [MVP] referred to a Microsoft Tool called
LogParser in a posting labeled "Search for a registry key with a certain
value" which may help you.

Google for it....
Dave
"LCD" <LC*@discussion s.microsoft.com > wrote in message
news:17******** *************** ***********@mic rosoft.com...
Here is what I want to do:

Presently in my registry I have:

(Default) = "C:\Program Files\myApp" and this value is scattered all over
registry in several keys and subkeys.

I wouldlike to have write a small c# app that will search the Data file
"C:\Program Files\myApp" and replace it with "E:\Data\myApp" . In regedit
one
can search for a certain data, but you can't do "Replace All" with a
certain
data type, hence this quest for writing and learning to interact with
Registry.

I have written apps in the past to read specific registry values, but
nothing generic of this nature. Can someone point me and advise me on how
to
do this. Any and all help is greatly appreciated.

Regards, LCD

Nov 17 '05 #3

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

Similar topics

11
16153
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have...
5
2025
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated one row, all of them were updated so i immediatelly figured out that i have to include the id of every entry in the update statement. This is where the problem is raised. My database is an Access database. The table i am updating contains a Date...
6
3027
by: jean.ulrich | last post by:
Hi I have a form that is not related with a table neither a query (unbound form) On this form I have a text field where the user can put a text or a number As I dont want to create a table just for that field, is it possible that when someone write someting in the field, the text don't disapear when he close the form and open it again
4
2370
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has two fields: a primary key and another holding a string. In table B there are three fields: a primary key, a foreign key (which links to the primary key in A) and other field holding a string.
22
3328
by: BULYABA | last post by:
Another tragedy for me; i have a form called visit form whose record source is visit table; this contains some similar fields like the Registry; forexample school; so i would like to know if i enter a value for the field school in the Visit form, how do i update the registry table. Thanks
2
3307
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the CurrentChanged event of the BindingSource of the combobox to update the textbox. When selecting an item in the combobox or when selecting a row in the grid, it is updating the textbox correctly. The problem is when I apply a filter in the grid, and then...
0
2490
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. In this table there are multiple columns that cannot be NULL, which, are bound to other controls (but they're not really important at this time). I create a new row via the currency manager like so: _currencyManager.AddNew() _currentRow =...
2
1226
by: ogo796 | last post by:
hi everyone i have a problem with updating the text file i want to add name at the end of a line and separate with semi colon, can someone look at my code and help me out. 2004 (12 November 2004) name tumi; yale; 2004 (12 November 2004) name simon; tiro; 2004 (12 November 2004) name lebo; dud ; <?php
1
2011
by: cerilocke | last post by:
I have a repeater in which I have a hidden field (input type = hidden), a textbox (asp:TextBox), a checkbox (input type = checkbox) and a label (asp:Label). I have bound all four items to the same bit field in a dataset, and when the items are first bound, all four are correctly databound. For example, if the stored procedure returns 1 for the value of the field, the value of the hidden field is True, the text that appears in the textbox...
0
8635
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 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...
0
7184
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
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();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
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
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1500
bsmnconsultancy
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.