0

I have a command that I want users to have some access to so that they can run batch files.

These files are ran nightly but sometimes the users can't wait.

They add an input file - Excel - and the batch file spits out a report based on the input file. Works great but I need this to be more just in time.

So I have a command line script that I run to execute the batch files:

token.exe /batch %batchname%

I would like to simply have an input field that they can write the batchname and hit submit for the corresponding job to be run.

Can I do this on a Windows Server? Do you have any example code to help get started?

And if it can't be done what do you suggest?

blankip
  • 340
  • 5
  • 18
  • Program execution Functions http://nz2.php.net/manual/en/ref.exec.php –  Jan 06 '14 at 21:07
  • http://php.net/system ? Read the first comment on this page also, it will probably interest you. – Martin Jan 06 '14 at 21:08

1 Answers1

0

You can use exec() for this purpose: http://www.php.net/manual/en/function.exec.php or other execution functions: https://www.php.net/manual/en/ref.exec.php, but make sure to escape all user input with this function: https://php.net/manual/en/function.escapeshellarg.php

alu
  • 759
  • 7
  • 20