Results 1 to 6 of 6

Thread: Script to execute a file

  1. #1
    Join Date
    Oct 2006
    Posts
    94
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Cool Script to execute a file

    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.

  2. #2
    Join Date
    Oct 2006
    Posts
    94
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    This article describes a way to execute batch/exe files using ASP

    Checkout this one for executing batch files or commands using PHP.

    Hope this helps

  5. #5
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    PHP Code:
    exec('path/to/your/batch/file'); 
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  6. #6
    Join Date
    Oct 2006
    Posts
    94
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you guys for your help with this. I now have a working script, both ASP and PHP, which executes a batch file.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •