Calling ExeOutput executable from Batch File on Windows with Parameters

Can I call my ExeOutput application from a BAT file and pass in parameters that will be picked up by the initial file. Let’s say my initial file is index.php (home page). My executable is myprogram.exe.

Can I have a bat file:

start C:\myprogram.exe parameter1

And then in my http://heserver/index.php pickup the parameters like http://heserver/index.php?arg1=parameter1?

Is there a way to run my application via command line and pass in variables/information?

Absolutely :slight_smile:

Have a look at PHP’s getopt function -

To test your example, you would run your batch file as…

start C:\myprogram.exe --arg1 parameter1

And pick that up in PHP using getopt…

   $options = getopt("",array("arg1:"));

Returning that to the CLI, you would get something like…

array(1) {
   string(8) "MYLAPTOP"

… but obviously you could use that in your code any way you choose :slight_smile:


Thank you! I will be trying this soon.

Have you had success with this before? I’ve done this for regular PHP scripts. But have you actually done this for an ExeOutput application? I am trying this and I am getting a NULL argv.

Maybe this can help in your case: