Click to See Complete Forum and Search --> : Export registry key


slcoder
March 1st, 2006, 01:50 AM
Is there API function that exports registry key?

golanshahar
March 1st, 2006, 03:02 AM
One way to do it is simply use ::CreateProcess(..) with regedit.exe command lines for export, here is a sample:


char szRegCommand[MAX_PATH];
::sprintf(szRegCommand,"regedit.exe /e:a \"c:\\Exported.reg\" \"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\"");
STARTUPINFO SI={0};
PROCESS_INFORMATION PI={0};
::CreateProcess(0,szRegCommand,0,NULL,false,CREATE_DEFAULT_ERROR_MODE,NULL,0,&SI,&PI);


Cheers

Mike Harnad
March 1st, 2006, 07:58 AM
Have you tried using RegSaveKeyEx?

golanshahar
March 1st, 2006, 08:17 AM
Have you tried using RegSaveKeyEx?

Looks promising somehow it missed that api :blush:

Cheers