473,729 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

local and remote machine registry export

i current have a way to read both local and remote machines registry keys and
create a textual view (.txt output).

i now looking for ways to do export of local and remote mahcine registry
keys into ".reg" file format via C#.

is this do able?
what do i need to research to do this?

or is where i need to windows WinApi?
Jun 27 '08 #1
12 5639
On Fri, 30 May 2008 13:15:01 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
i current have a way to read both local and remote machines registry
keys and
create a textual view (.txt output).
In C#?
i now looking for ways to do export of local and remote mahcine registry
keys into ".reg" file format via C#.
If you already have code that produces text output of the registry, you're
most of the way there. The .reg file format is extremely simple. You
just need to specify specific key paths in square braces, with individual
values following. Here's a reasonable complete discussion:
http://support.microsoft.com/kb/310516

Other than following that specific format, I wouldn't expect much changes
from the code you already have.
is this do able?
what do i need to research to do this?
If you don't already have text output of the registry using .NET, you may
want to look here:
http://msdn.microsoft.com/en-us/libr....registry.aspx

Pete
Jun 27 '08 #2
Peter,
thanks for your response.
yes i have C# code to create a textual file of the registry key hive i want.
but i read the 2 kbs and i don't see how to use C# to create the ".reg" file
export.
they talk about using regedit. i can not export remote machine registry keys
this way.

i need to create an export file in ".reg" format for both local and remote
servers (machines).
"Peter Duniho" wrote:
On Fri, 30 May 2008 13:15:01 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
i current have a way to read both local and remote machines registry
keys and
create a textual view (.txt output).

In C#?
i now looking for ways to do export of local and remote mahcine registry
keys into ".reg" file format via C#.

If you already have code that produces text output of the registry, you're
most of the way there. The .reg file format is extremely simple. You
just need to specify specific key paths in square braces, with individual
values following. Here's a reasonable complete discussion:
http://support.microsoft.com/kb/310516

Other than following that specific format, I wouldn't expect much changes
from the code you already have.
is this do able?
what do i need to research to do this?

If you don't already have text output of the registry using .NET, you may
want to look here:
http://msdn.microsoft.com/en-us/libr....registry.aspx

Pete
Jun 27 '08 #3
On Fri, 30 May 2008 15:31:00 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
thanks for your response.
yes i have C# code to create a textual file of the registry key hive i
want.
but i read the 2 kbs and i don't see how to use C# to create the ".reg"
file
export.
they talk about using regedit. i can not export remote machine registry
keys
this way.

i need to create an export file in ".reg" format for both local and
remote
servers (machines).
The first article I provided documents the .reg file format. I'm not
aware of any support in .NET to write the format automatically (though it
might yet exist). But the format is so simple that if you already have
code to emit the registry information in _any_ format, it shouldn't take
you more than 15 minutes or so to change the code to comply with the
actual .reg file format. 30 minutes at the outside.

Heck...from scratch, the whole thing should a few hours work at the most,
and quicker for someone already very familiar with .NET.

Pete
Jun 27 '08 #4
will the file i create be able to be used by regedit to import on a machine?
i light is still not coming on.
"Peter Duniho" wrote:
On Fri, 30 May 2008 15:31:00 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
thanks for your response.
yes i have C# code to create a textual file of the registry key hive i
want.
but i read the 2 kbs and i don't see how to use C# to create the ".reg"
file
export.
they talk about using regedit. i can not export remote machine registry
keys
this way.

i need to create an export file in ".reg" format for both local and
remote
servers (machines).

The first article I provided documents the .reg file format. I'm not
aware of any support in .NET to write the format automatically (though it
might yet exist). But the format is so simple that if you already have
code to emit the registry information in _any_ format, it shouldn't take
you more than 15 minutes or so to change the code to comply with the
actual .reg file format. 30 minutes at the outside.

Heck...from scratch, the whole thing should a few hours work at the most,
and quicker for someone already very familiar with .NET.

Pete
Jun 27 '08 #5
i think i can build the string and dword registry key to mimic the regedit
export file. but i'm seeing a problem constructing the "REG_MULTI_ SZ" output
so that it mimics the regedit structure.

my code does a good job of getting the string but i'm not understanding how
to keep the value as binary.

"auldh" wrote:
will the file i create be able to be used by regedit to import on a machine?
i light is still not coming on.
"Peter Duniho" wrote:
On Fri, 30 May 2008 15:31:00 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
thanks for your response.
yes i have C# code to create a textual file of the registry key hive i
want.
but i read the 2 kbs and i don't see how to use C# to create the ".reg"
file
export.
they talk about using regedit. i can not export remote machine registry
keys
this way.
>
i need to create an export file in ".reg" format for both local and
remote
servers (machines).
The first article I provided documents the .reg file format. I'm not
aware of any support in .NET to write the format automatically (though it
might yet exist). But the format is so simple that if you already have
code to emit the registry information in _any_ format, it shouldn't take
you more than 15 minutes or so to change the code to comply with the
actual .reg file format. 30 minutes at the outside.

Heck...from scratch, the whole thing should a few hours work at the most,
and quicker for someone already very familiar with .NET.

Pete
Jun 27 '08 #6
On Fri, 30 May 2008 21:21:00 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
will the file i create be able to be used by regedit to import on a
machine?
i light is still not coming on.
Yes. The .reg file format is just a text file with a particular format
for the text contained within.

Again, I direct you to the Microsoft KB article I mentioned earlier, that
describes the format.

Pete
Jun 27 '08 #7
Peter you are smarter person than i.
i understand what i read. but using the C# registry class i don't see how to
get the "REG_MULTI_ SZ".

i can get a string output but i can not build the output as created by
regedit:
"WrapperCompone ntList"=hex(7): 4d,00,53,00,44, 00,45,00,00,00, 53,00,45,00,52, 00,\
56,00,45,00,52, 00,5f,00,4d,00, 52,00,53,00,5f, 00,4c,00,4f,00, 43,00,41,00,4c, \
00,00,00,4c,00, 41,00,4e,00,47, 00,55,00,41,00, 47,00,45,00,5f, 00,45,00,4e,00, \
47,00,4c,00,49, 00,53,00,48,00, 55,00,53,00,00, 00,43,00,4f,00, 4d,00,4d,00,55, \
00,4e,00,49,00, 43,00,41,00,54, 00,49,00,4f,00, 4e,00,53,00,5f, 00,43,00,4c,00, \
49,00,45,00,4e, 00,54,00,00,00, 41,00,50,00,50, 00,47,00,45,00, 4e,00,00,00,4d, \
00,4d,00,43,00, 5f,00,53,00,4e, 00,41,00,50,00, 49,00,4e,00,00, 00,54,00,54,00, \
53,00,5f,00,45, 00,4e,00,47,00, 49,00,4e,00,45, 00,00,00,00,00

i need to be able to create registry export file for both local and remote
machine/server that another group can restore via regedit to work in a lab.
the output file needs to mimic the registry export.

however creating a program to run regedit command line will only work on the
local machine. my task is to export the registry for both the master and
slave server so i can provide the data to someone else.

i can get to the string, dword but the muti_sz string is where i'm failing.
they build a string output.

"Peter Duniho" wrote:
On Fri, 30 May 2008 21:21:00 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
will the file i create be able to be used by regedit to import on a
machine?
i light is still not coming on.

Yes. The .reg file format is just a text file with a particular format
for the text contained within.

Again, I direct you to the Microsoft KB article I mentioned earlier, that
describes the format.

Pete
Jun 27 '08 #8
On Mon, 02 Jun 2008 12:48:01 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
Peter you are smarter person than i.
Maybe. Maybe not. Too early to tell. :)
i understand what i read. but using the C# registry class i don't see
how to
get the "REG_MULTI_ SZ".

i can get a string output but i can not build the output as created by
regedit:
"WrapperCompone ntList"=hex(7): 4d,00,53,00,44, 00,45,00,00,00, 53,00,45,00,52, 00,\
56,00,45,00,52, 00,5f,00,4d,00, 52,00,53,00,5f, 00,4c,00,4f,00, 43,00,41,00,4c, \
00,00,00,4c,00, 41,00,4e,00,47, 00,55,00,41,00, 47,00,45,00,5f, 00,45,00,4e,00, \
47,00,4c,00,49, 00,53,00,48,00, 55,00,53,00,00, 00,43,00,4f,00, 4d,00,4d,00,55, \
00,4e,00,49,00, 43,00,41,00,54, 00,49,00,4f,00, 4e,00,53,00,5f, 00,43,00,4c,00, \
49,00,45,00,4e, 00,54,00,00,00, 41,00,50,00,50, 00,47,00,45,00, 4e,00,00,00,4d, \
00,4d,00,43,00, 5f,00,53,00,4e, 00,41,00,50,00, 49,00,4e,00,00, 00,54,00,54,00, \
53,00,5f,00,45, 00,4e,00,47,00, 49,00,4e,00,45, 00,00,00,00,00
Well, what exactly is it that you're having difficulty with?

I mean, I can see a number of places that might trip a person up, but if
you can already output the registry as a .txt file (as you wrote in your
original post), how does that output differ from the above? What do you
need help with specifically?

Pete
Jun 27 '08 #9
the output i can create for a "multi_sz" is something like this:
Number of records in WrapperComponen tList = 4
WrapperComponen tList = (REG_MULTI_SZ) DRIVER_US
WrapperComponen tList = (REG_MULTI_SZ) MSDE
WrapperComponen tList = (REG_MULTI_SZ) SERVER_MRS_LOCA L
WrapperComponen tList = (REG_MULTI_SZ) LANGUAGE_ENGLIS HUS

my code:
else if (t == System.Type.Get Type("System.St ring[]"))
{
String[] sval = (String[])regvalue;
sw.WriteLine(St ring.Format("Nu mber of records in {0} =
{1}", valueName, sval.Length.ToS tring()));
for (int i = 0; i < sval.Length; i++)
{
sw.WriteLine("\ t\t{0} = (REG_MULTI_SZ) {1}",
valueName, sval[i]);
}
}
else
{
sw.WriteLine(St ring.Format("\t \tValue Name: {0}; Data:
{1} ; Type: {2}", valueName, regvalue.ToStri ng(), t));
}

creates the output to be strings as seen above.
and according to "regedit" it can not import the structure i have.

the output file needs to have the following format:
"WrapperCompone ntList"=hex(7): 44,00,52,00,49, 00,56,00,45,00, 52,00,5f,00,55, 00,\
53,00,00,00,4d, 00,53,00,44,00, 45,00,00,00,53, 00,45,00,52,00, 56,00,45,00,52, \
00,5f,00,4d,00, 52,00,53,00,5f, 00,4c,00,4f,00, 43,00,41,00,4c, 00,00,00,4c,00, \
41,00,4e,00,47, 00,55,00,41,00, 47,00,45,00,5f, 00,45,00,4e,00, 47,00,4c,00,49, \
00,53,00,48,00, 55,00,53,00,00, 00,00,00

i must be over thinking this cause i'm not having success stepping through
the registry value to create the ascii string above.

"Peter Duniho" wrote:
On Mon, 02 Jun 2008 12:48:01 -0700, auldh
<au***@discussi ons.microsoft.c omwrote:
Peter you are smarter person than i.

Maybe. Maybe not. Too early to tell. :)
i understand what i read. but using the C# registry class i don't see
how to
get the "REG_MULTI_ SZ".

i can get a string output but i can not build the output as created by
regedit:
"WrapperCompone ntList"=hex(7): 4d,00,53,00,44, 00,45,00,00,00, 53,00,45,00,52, 00,\
56,00,45,00,52, 00,5f,00,4d,00, 52,00,53,00,5f, 00,4c,00,4f,00, 43,00,41,00,4c, \
00,00,00,4c,00, 41,00,4e,00,47, 00,55,00,41,00, 47,00,45,00,5f, 00,45,00,4e,00, \
47,00,4c,00,49, 00,53,00,48,00, 55,00,53,00,00, 00,43,00,4f,00, 4d,00,4d,00,55, \
00,4e,00,49,00, 43,00,41,00,54, 00,49,00,4f,00, 4e,00,53,00,5f, 00,43,00,4c,00, \
49,00,45,00,4e, 00,54,00,00,00, 41,00,50,00,50, 00,47,00,45,00, 4e,00,00,00,4d, \
00,4d,00,43,00, 5f,00,53,00,4e, 00,41,00,50,00, 49,00,4e,00,00, 00,54,00,54,00, \
53,00,5f,00,45, 00,4e,00,47,00, 49,00,4e,00,45, 00,00,00,00,00

Well, what exactly is it that you're having difficulty with?

I mean, I can see a number of places that might trip a person up, but if
you can already output the registry as a .txt file (as you wrote in your
original post), how does that output differ from the above? What do you
need help with specifically?

Pete
Jun 27 '08 #10

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

Similar topics

11
4201
by: Mike MacSween | last post by:
My client has an MS Access database application on her local machine. I have full access to that in terms of changing the design. I've got a simple PHP/MySql application on shared hosting, so no direct access to the db server. I'd like to give her the facility to export the information in her local Access application to the shared PHP/MySql site. From one command button (or similar) in the Access application.
1
1774
by: Cherry | last post by:
Hi, can I access the registry of a remote machine using VB.NET? While connecting to the remote machine I would be using the admin login of that machine. Thanks.
4
4758
by: oceanhai | last post by:
We currently have a PPTP connection set up for our developers to access our development SQL server through a VPN tunnel. When they need to copy tables up to the dev SQL from their local machine they simply do a DTS copy. However, we are now moving to a thin client solution where they will be working on a terminal server. They will have access to the development SQL servers and SQL tools such as EM and QA. However, they will not have...
2
2264
by: enrique | last post by:
Hello everyone, I'm looking for a "directory path" solution that will allows me to test my app locally and then test on remote web server without having to update my web.config file each time I modify the file. In other words I'm storing the paths (for centralizing purposes) as custom <appSettings> in the web.config. expample (for local testing): <add key="imagePath" value="http://localhost/app_folder/10_media/images/" />
1
1897
by: lauralucas | last post by:
Hello I'm using ASP.NET 1.1, Visual Studio 2003, IIS 5.1 and windows XP as development machine. I can work in this machine locally and create web apps that I can access via localhost. No problem at all. Now, I'm trying to deploy the app I done to a windows 2003 server, with IIS 6.0 and in wich I installed the Visual Studio 2003 server components (for web development). It has ASP.Net 1.1 too.
3
4594
by: Geoff McElhanon | last post by:
I have been struggling with a security issue that occurs under .NET 2.0, but does not occur under .NET 1.1. Essentially I am trying to open up a performance counter on a remote server and monitor its value. In .NET 1.1 this worked fine, however under .NET 2.0 it fails when I am not an administrator on the remote server. To provide a lean demonstration of the issue, I created the following class: ============================
3
8321
by: JB | last post by:
I am trying to access a registry key on computer like so: key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, computerName).OpenSubKey(Subkey); There are two keys I am trying to read, 1 works, and the other gives me the "Requested registry access is not allowed." i've narrowed it down to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office It doesnt let me access that path, but the permissions are the same.
8
6672
by: Hayato Iriumi | last post by:
Hello, folks. I have a need to get the value of %windir% on a remote machine. Is it possible to get this value using C#?
4
1816
by: quincy451 | last post by:
I am running MS SQL 2000 server. The table involved is only about 10,000 records. But this is the behavior I am seeing. The local machine is querying the table looking for a particular record. Everything works fine. The remote amchine goes to clear the table and then insert all 10,000 records, into the table the following happens. 1) the local machines queries do not compilete until the remote machine is done.
1
9200
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,...
0
9142
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 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...
0
8148
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
6722
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
6022
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
4525
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
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
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
3
2163
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.