Click here to Skip to main content
15,917,637 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
See more:
Hello everyone,

I have a .exe file compiled using Visual Studio C#. Now I am writing a software, I need is to take some parameter from user and run .exe file, and save the output locally.


for example:
Name of exe is= abc.exe and i want to passed the manadotary parameter to that exe
parameter=param

abc.exe param

Could anyone please tell how could I do this?
Posted
Updated 10-May-15 19:28pm
v2

You will need to use command line arguments:

https://msdn.microsoft.com/en-us/library/aa288457(v=vs.71).aspx[^]

CP article here: C#/.NET Command Line Arguments Parser[^]
 
Share this answer
 
v2
Passing command-line parameters to an application:
https://msdn.microsoft.com/en-us/library/system.diagnostics.process.start%28v=vs.110%29.aspx[^].

For parsing command line in the application, please see my detailed article: Enumeration-based Command Line Utility[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900