-
Jul 12th, 2005, 06:39 AM
#1
Thread Starter
New Member
How to Copy and Paste Registry Key?
Anyone know the code to copy key and paste into other key so that i can backup the important key to a safe place. I know it can be export. But i wanna try using Visual Basic .NET cos i just start learning this...
-
Jul 12th, 2005, 07:16 AM
#2
Re: How to Copy and Paste Registry Key?
A .reg file is just plain text. You just need to determine exactly what the format is, then you can use a StreamWriter to create a new text file with a .reg extension.
-
Jul 12th, 2005, 08:23 AM
#3
Thread Starter
New Member
Re: How to Copy and Paste Registry Key?
I want to do it using visual basic .net...
-
Jul 12th, 2005, 09:48 AM
#4
Re: How to Copy and Paste Registry Key?
A StreamWriter is a .NET Framework class. Look it up!
Once you know what the format of a .reg file looks like, you can write VB.NET code to read a registry key using the members of the Microsoft.Win32 namespace. You can then write more code to use a System.IO.StreamWriter object to create a new text file with a .reg extension and write the registry key data in the required format.
-
Jul 12th, 2005, 01:11 PM
#5
Frenzied Member
Re: How to Copy and Paste Registry Key?
Microsoft.Win32.RegistryKey class has excellent members to get the data you want and to set data.. examples are GetValue() and SetValue()
You need to create two objects of RegistryKey type and you can read one and write to the other.
-
Jul 12th, 2005, 02:40 PM
#6
Re: How to Copy and Paste Registry Key?
Why would you want to only backup a key and not the entire registry?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Jul 12th, 2005, 08:23 PM
#7
Re: How to Copy and Paste Registry Key?
I just re-read the original post and I realised that it is asking how to copy a key to another location within the registry. This seems an odd request. How is one key any safer than another?
-
Jul 12th, 2005, 08:29 PM
#8
Thread Starter
New Member
Re: How to Copy and Paste Registry Key?
Can this be done in a short and simple way... cos i am a beginner... i will be very happy if you show me the code.... thnx
-
Jul 12th, 2005, 08:39 PM
#9
Re: How to Copy and Paste Registry Key?
Why do you need to copy and paste it? Thats an unusual request.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Jul 12th, 2005, 08:42 PM
#10
Re: How to Copy and Paste Registry Key?
Lookup the RegistryKey class in the help documentation and you'll get an example. Reading about the class will give you a better understanding than simply copying something one of us posts here. It's good practice at using the help system, too. It should become your best friend.
-
Jul 12th, 2005, 08:54 PM
#11
Re: How to Copy and Paste Registry Key?
I can't think of a good reason to be doing that. I can however think of a few not so good reasons to want to try to do that.
-
Jul 12th, 2005, 09:31 PM
#12
Thread Starter
New Member
Re: How to Copy and Paste Registry Key?
Anyone please show me the code for copy a registry key and paste into a registry key.. i just wanna try out... i know how to create key and delete key, i learn from MSDN but MSDN don have teach how to copy and paste... so any kind people please teach me..
-
Jul 12th, 2005, 10:05 PM
#13
Re: How to Copy and Paste Registry Key?
I believe some of us are concerned with the nature of this question and want to make sure its
not against the Forums AUP
Can you provide us with more details?
Usually if the registry get corrupt, Windows will become unusable and how would you restore (paste) a
registry key back in. Not to mention that a single key wouldnt help the corruption.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Jul 13th, 2005, 05:34 AM
#14
Thread Starter
New Member
Re: How to Copy and Paste Registry Key?
I recent have visit this web site http://www.winguides.com/registry/ i have learn quite a lot of thing inside... after that i start using Visual Studio .NET.. so i was thinking that i can use VB. net to do those setting inside registry(setting like disallowrun etc, i use this setting in my younger brother de windows account so he oni able to run game not other thing).... i want create a key call Explorer1 inside HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\. then i copy the content of Explorer to Explorer1... just wanna backup inside registry... just like everything is done inside registry...
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
|