-3

How do I run programs "in" my program?

When I click a button, I want it to run a .reg file that I added to a folder in Visual Studio, like this:

TestKey.reg is what I want to be ran when I click a button.

Umair M
  • 10,298
  • 6
  • 42
  • 74
  • 5
    Possible duplicate of [C# - Import reg file to the registry without user confirmation box](http://stackoverflow.com/questions/2171431/c-sharp-import-reg-file-to-the-registry-without-user-confirmation-box) – Murray Foxcroft Sep 08 '16 at 15:20
  • 1
    Possible duplicate of: [c# - Run Command Prompt Commands](http://stackoverflow.com/questions/1469764/run-command-prompt-commands) – byxor Sep 08 '16 at 15:20

1 Answers1

0

First of all, you should define a build action as "content" and "Copy file" field should be equal to "Always". After that, you should use System.Diagnostics.Process.Start function and specify your .reg file name in arguments.