|
-
April 25th, 2005, 08:36 AM
#1
Usage of regedit in C#
Hi All,
How can i export windows registry using C#.
pls
-
April 25th, 2005, 12:18 PM
#2
Re: Usage of regedit in C#
Hi, it is a well known secret (?) that you can export registry keys from the command line prompt by typing
regedit /e outputfile "regkey"
Apparently it is important to surround regkey with ".
So, if you can use the command line prompt to export registry keys, you can use C# to do it. How? With System.Diagnostics.Process.
Code:
System.Diagnostics.Process RegistryExportProcess = new System.Diagnostics.Process();
RegistryExportProcess.StartInfo.Arguments =
"/e c:\\regexp.reg \"HKEY_CURRENT_USER\\Software\\Microsoft\\HyperTerminal\"";
RegistryExportProcess.StartInfo.FileName = "regedit";
RegistryExportProcess.Start();
Note: I'm not sure if this is valid for Windows 95/98/Me though.
HTH!
Last edited by Anders; April 25th, 2005 at 12:19 PM.
Reason: Added note about Windows 95/98/Me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|