Menu
Command-line options for msiexec.exe for Windows Installer 3.0 and earlier. Provides a table showing options, parameters, and descriptions. Examples showing how to install products and other tasks. When it came time to run the.exe, I just double clicked the program and it kept crashing. As soon as i ran the.exe from a command line like this program.exe @, all was right with the world. – jazzBox Nov 15 '18 at 14:01. 25 rows VSTest.Console.exe command-line options.; 3 minutes to read; In this article. Specifies that what follows on the command line is the value that will be returned by the Command function. This option must be the last switch on the command line. You can use a semicolon (;) as an alternative to /cmd. Use this switch to specify a command-line argument that can be used in Visual Basic for Applications (VBA) code. The following command-line options are available for Windows Setup. Beginning with Windows 10, version 1607, you can use a setupconfig file as an alternative to passing paramters to Windows Setup on a command line. For more information, see Windows Setup Automation Overview.
Active1 year, 5 months ago
I'm trying to execute a command line program with parameters from C#. I would have imagined that standing this up and making this happen would be trivial in C# but its proving challenging even with all the resources available on the this site and beyond. I'm at a loss so I will provide as much detail as possible.
My current approach and code is below and in the debugger the variable command has the following value.
The problem may be how I am calling and formatting the string I use in that variable command.
Any thoughts on what might be the issue?
I get back no information or error in the variable result once its completes.
Hkachhia3,35233 gold badges2828 silver badges6363 bronze badges
Bryan HarringtonBryan Harrington
44822 gold badges1111 silver badges2727 bronze badges
3 Answers
Dmitry BychenkoDmitry Bychenko124k1515 gold badges115115 silver badges151151 bronze badges
I realized I may have left out some detail that some people may need to solve this in the future.
Here are the values of the method parameters at run time. I had some confusion as to what the object ProcessStartInfo and Process needed to be stood up correctly I think others may as well.
exeDir = 'C:folder1folder2binkeytool.exe'
args = '-delete -noprompt -alias server.us.goodstuff.world -storepass changeit -keystore keystore.jks'
Between Dmitry's assistance and the following resource,
I was able to cobble this together. Thank you!
Bryan HarringtonPowershell.exe Command Line Parameters
Bryan HarringtonSetup.exe Command Line Parameters
44822 gold badges1111 silver badges2727 bronze badges
When it comes to executing CLI processes from C#, it may seem like a simple task, but there are quite a few pitfalls that you might not even notice until much later. For example, both of the currently given answers will not work if the child process writes enough data to stdout, as explained here.
I wrote a library that simplifies working with CLIs by abstracting the
Process
interaction entirely, solving the whole task by executing one method - CliWrap.Your code would then look like this:
TyrrrzTyrrrz