programmatically merge .reg file into win32 registry

后端 未结 5 2286
猫巷女王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条回答
  •  Happy的楠姐
    2021-01-18 21:45

    I looked into it by checking out my file associations.

    It seems that a .reg file is just called as the first parameter to the regedit.exe executable on Windows.

    So you can just say regedit.exe "mytest.reg". What I'm not sure of is how to get rid of the dialog box that pops up that asks for your confirmation.

提交回复
热议问题