What\'s the best way to programmatically merge a .reg file into the registry? This is for unit testing; the .reg file is a test artifact which will be added then removed at
If you're shelling out, I'd use the reg command (details below). If you can tell us what language you're working with, we could provide language specific code.
C:>reg /?
REG Operation [Parameter List]
Operation [ QUERY | ADD | DELETE | COPY | SAVE | LOAD | UNLOAD | RESTORE | COMPARE | EXPORT | IMPORT | FLAGS ]
Return Code: (Except for REG COMPARE)
0 - Successful 1 - Failed
For help on a specific operation type:
REG ADD /? REG DELETE /? [snipped]