473,387 Members | 1,423 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,387 software developers and data experts.

Change registry key's name

Hello, all!

I have next problem: I don't know how I can change registry key's name in
C#. Help me please, if you know solution of this problem.

Thank You.

--
__________________
Best regards,
Dmitriy Kolesnik,
SoftScape team
Nov 17 '05 #1
2 5334
Dmitriy Kolesnik wrote:
I have next problem: I don't know how I can change registry key's name in
C#. Help me please, if you know solution of this problem.


Registry keys cannot be renamed. The managed registry wrapper also
doesn't have the ability to copy a key, as far as I know. You'll have to
use the API function RegCopyTree to make a copy of the key in question,
complete with children, then delete the original key.
Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog
Nov 17 '05 #2
Oliver Sturm wrote:
You'll have to
use the API function RegCopyTree to make a copy of the key in question,
complete with children, then delete the original key.


I just found that this API function is apparently very new, docs at MS
say it's only available in Longhorn. I didn't notice that before because
I didn't assume there would be registry API functions that are actually
only introduced in Longhorn.

So, the alternative approch should be to create a new key, iterate
recursively through the source key and its children and copy them over
to the new key. Finally, delete the old key. The advantage is that you
should be able to do that with the normal managed registry wrappers that
the .NET SDK provides.

Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog
Nov 17 '05 #3

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

Similar topics

2
by: Ed P. | last post by:
hello, I want to check to see if a certain registry key exists on the registry. What's the easiest way to do this. Here is what I am currently doing. private string registryKey =...
6
by: mphanke | last post by:
Hi, how can I retrieve the icon for a registered file extension from the registry and show it in my ListView? Any hints appreciated, Martin
21
by: Kevin Swanson | last post by:
I'm attempting some remote registry manipulation via C#. I've written a test app to simply grab a specified key from a specified hive on a specified machine. The call to OpenSubKey is throwing...
12
by: Li Pang | last post by:
Hi, I'd like to know how to remove registry keys which contain a value of 'appkeyA' or 'appkeyB' or 'appkeyC' ...? thanks in advance
9
by: Newbie Coder | last post by:
Hello Newsgroup Readers I would like to know how to go & do the following: I have a certain registry key that has sub values Example: Key1 http://www.microsoft.com Key2 ...
4
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
I have Visual Studio 2005 Express Edition. I am trying to change registry value by: RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\My_app"); key.SetValue(name_of_value,...
4
pritipshah
by: pritipshah | last post by:
Hello All, I want to Access Registry from PHP script. I had sreach on net and I got Class for this which is as below. <?php class Registry { private $vars = array();...
4
by: CDMAPoster | last post by:
In: http://groups.google.com/group/comp.databases.ms-access/msg/f06bd4c45037ef29 Lyle wrote: :Terry Kreft wrote: : :>Suck it and See? :
11
by: Unknown Hero | last post by:
Tim Golden wrote: The first link which points to the Python documentation for the _winreg module I already checked, even before coming here. I am wondering how I should do the loop I need (go...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.