Archive: How to copy a registry key?


How to copy a registry key?
ReadRegStr and WriteRegStr only copy REG_SZ.How to detect a entry is String,DWORD or Binary?.


A certain value of an application always has a certain type.

You can browse the registry and view all types using the Windows registry editor.


I can browse the local system to detect regsitry type,but I can not detect in user's system.


Why do you expect that the type will be different?


It is useful in files ASSOC.Such as "HKCR\.mp3",it originality default value is "foobar2000.mp3",and "HKCR\foobar2000.mp3" contain some context menu "HKCR\foobar2000.mp3\shell\enqueue", "HKCR\foobar2000.mp3\shell\play".
If I change "HKCR\.mp3" default value to Winamp.file,the context menu will be lost.
So I want to copy the whole key "HKCR\foobar2000.mp3" to "HKCR\Winamp.file" and then doing FileAssoc.
This would keep the context menu.
These is a instance in ACDSee 3.1 SR1's FileAssoc.
Or somebody may a plugins like
CopyReg::Copy SRC_ROOT_KEY SRC_SUB_KEY DEST_ROOT_KEY DEST_SUB_KEY£¿


You can create a NSIS plug-in using this code:

http://www.codeproject.com/system/registrykeycopy.asp

(this site doesn't seem to work right now, so you may want to use the Google cache)


Oh,my god,I don't know C.Is these somebody help me?Make a plugins like this.


Try the attached nsh file. There is an example script as well.
This has been tested with Windows 2000 and Windows XP. I don't know if it will work with Win9x or WinNT, which is why I haven't uploaded to the archive.