Tuesday, August 28, 2018

Pass something into the arguments for an executable from the command line.

I made a WinForms app and I jammed in string[] args as seen here at a console app in my in Visual Studio 2017 dabblings. I made an installer for the WinForm app, and I ran the installer and then figured out where it put the .exe executable file. I navigated to that folder at the command prompt and then ran the executable by passing a variable to it like so:

foo.exe bar

 
 

"bar" ended up as the first string in string[] args

No comments:

Post a Comment