0

I have an app I would like to create to be used as a console environment as well as a Windows environment.

For example...

1) From command window

I want to open command prompt and type myapp.exe --help for it to show my the console output of...

c:\myapp.exe

Usage: myapp.exe [--option]
Switches:
  --help : Shows this information.
  --ver  : Shows version.

2) From window

I want to double click on myapp.exe and it to show a form window instead.


Currently I do this by setting the project type to Console Application but this also shows a console window under my form when I double click it.

Is there a way to create the application to be used in both environments?

Arvo Bowen
  • 4,524
  • 6
  • 51
  • 109
  • 1
    [AttachConsole](https://msdn.microsoft.com/en-us/library/windows/desktop/ms681952.aspx) – IInspectable Jul 10 '16 at 23:03
  • Show or Hide Console : http://stackoverflow.com/questions/3571627/show-hide-the-console-window-of-a-c-sharp-console-application –  Jul 10 '16 at 23:05
  • I'm not sure if I should flag this as a dup or just delete it. @IInspectable that lead me to exactly what I needed... http://stackoverflow.com/questions/807998/how-do-i-create-a-c-sharp-app-that-decides-itself-whether-to-show-as-a-console-o – Arvo Bowen Jul 10 '16 at 23:20

0 Answers0