0

There is 2 ways that I can run exe file: with double click or via command line. I want to do different function from each way..

Is it possible?

Thanks!

Or K
  • 335
  • 1
  • 5
  • 12
  • 1
    Use a command line when running from the command line, e.g. use command$ to detect yourapp.exe -c – Alex K. Aug 09 '16 at 12:30
  • 1
    Get parent process handle http://stackoverflow.com/questions/185254/how-can-a-win32-process-get-the-pid-of-its-parent and examine whether it was launched from cmd.exe or explore.exe. – vitsoft Aug 09 '16 at 17:50
  • 1
    question unclear, not specific. More details plz. – Juan-Carlos Aug 10 '16 at 07:56

1 Answers1

1

You could also start via a Process, Schedule, register an extension, Autostart any many more. You need to tell us what you want to achieve for a satisfying answer. Following Answer is for switch a command-line and a gui mode.

If you have the Install of you Program in you hands, you can simply use "Command" to read the commandline arguments and use that for a command line mode and a gui mode. Make a switch like "-gui" and simply write

If Command = "-gui" Then
    frmMain.Show
End If
efkah
  • 1,628
  • 16
  • 30