Running a console app with arguments from C# - GUI Hookup Advice

11,692

This is not answer to question above -- see comments to question above.

In Project Properties dialog, on Debug tab you can define command line arguments and working directory.

Share:
11,692
ina
Author by

ina

moody. perchance bipolar. i'm even crazier on answers.unity3d.com and a few other stackX's :)

Updated on June 05, 2022

Comments

  • ina
    ina almost 2 years

    (Warning: This is a C# n00b question! Trying to learn a bit of C# while making things easier for a console app I run frequently.)

    I'm trying to run a console application (consoleapp.exe) without having to manually type in the arguments each time - The command is typically of this form:

    C:/consoleapp.exe --username (uname) --password (pass) --inputfile "c:/pathtofile/filename.xml"

    Using C# I might even be able to load up a Windows explorer file prompt, instead of having to manually type in the file path each time. How would I go about doing this?

    I tried the snippet at this link. I got it to work by just replacing the ApplicationPath with the path to my cojnsole app, and ApplicationArguments with the arguments shown in the format above, except I'm not sure how to hook up the parameters with the VC# GUI tools, or to relay the output I get from the original console app back.

  • Dyppl
    Dyppl over 13 years
    Although I'm not exactly sure if that's what you asked about and if it helps