programmatically merge .reg file into win32 registry

后端 未结 5 2115
猫巷女王i
猫巷女王i 2021-01-18 21:36

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

5条回答
  •  盖世英雄少女心
    2021-01-18 21:53

    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]

提交回复
热议问题