Log in

View Full Version : Script to execute a file



smithster
05-22-2007, 04:46 PM
I use a webbased control panel to start a COD2 server. I am quite keen to learn how to do this myself. I know of 2 ways to start a COD2 server from home. Either through the exe file and amend the command line. Or you can make a batch file to do the exact same thing.

I have heard before that a web page is not able to execute a exe file. But can a webpage start a batch file?

If it's possible perhaps someone could direct me to the script that you help this to work???

Thanks.

Smithster.

smithster
05-22-2007, 05:00 PM
Ive been reading through the forums. Ive seen that similar questions have been asked before about this sort of thing. I am assuming what I need to be done would be done by the use of ASP and batch files though I would rather it be a PHP script. Ive noticed the answers to others are about security risks envolved and I just want to make it known that this what I am trying to acomplish is completely server side. The batch file is also on the server itself. No batch file is ran from the client.

djr33
05-22-2007, 05:50 PM
I'm not really sure on this one, but I'd think PHP would be just as possible as ASP, if either is.
And, yeah, the problem here is security.

Using shell(), and other system commands might work. Probably best to look at those.

codeexploiter
05-23-2007, 03:29 AM
This article (http://classicasp.aspfaq.com/general/how-do-i-execute-a-dos-command/batch-file/exe-from-asp.html) describes a way to execute batch/exe files using ASP

Checkout this one (http://au2.php.net/language.operators.execution) for executing batch files or commands using PHP.

Hope this helps

tech_support
05-23-2007, 07:45 AM
exec('path/to/your/batch/file');

smithster
05-23-2007, 06:39 PM
Thank you guys for your help with this. I now have a working script, both ASP and PHP, which executes a batch file.