Home > Software engineering >  Execute program and enter 'string[] args' through windows command prompt
Execute program and enter 'string[] args' through windows command prompt

Time:12-05

I heard somewhere that it is possible to execute program and enter 'string[] args' of main function by cmd in Linuxenter image description here

Is it possible to do the same in Windows? Can I execute program and add this arguments to main function by Windows cmd?
I want to do something like this: enter image description here

CodePudding user response:

Sure, just add the arguments as you would to any other program. Separation characters or quotes are not necessary, unless you need to pass an argument that contains spaces by itself. You don't normally need to use the start command to launch an application either. So your command line will just be

myprogram arg1 arg2 arg3
  • Related