在Golang中运行带有选项的exe

I have an .exe installer, let's say installer.exe On command line, I can run the following command:

installer /quiet OPT=XY  

It runs successfully and uses those options.

Now, I want to run the same thing using GoLang code

To just run the installer, the following works:

cmd := exec.Command("CryptovisorClient")  

However, I want to run the entire command with the options - installer /quiet OPT=XY

How do I achieve this in the Go code?

Take a look at exec.Command's docs. It shows that the args can be passed in as a variadic. Therefore you should be able to do:

cmd := exec.Command("installer", "/quiet", "OPT=XY")

Now, I don't do much windows (and it looks like those are windows style flags), but I believe that will work.