Results 1 to 2 of 2

Thread: PHP and Windows Services

  1. #1
    Join Date
    Aug 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy PHP and Windows Services

    Any one know how to restart a windows service using PHP ?

    This is what ive done so far ....


    --
    start.bat
    --

    @echo off
    echo <<NAME OF SERVICE>> is starting ...
    echo Starte <<NAME OF SERVICE>> ...
    <<SERVICE EXE FILE>> /start

    -----

    --
    stop.bat
    --

    @echo off
    echo <<NAME OF SERVICE>> is stopping ...
    echo Stoppe <<NAME OF SERVICE>> ...
    <<SERVICE EXE FILE>> /stop

    ------

    My php file


    --
    service_control.php
    --

    function start() {
    exec("start.bat");
    }

    function stop() {
    exec("stop.bat");
    }

    ----

    Any idea why this dnt work ?

  2. #2
    Join Date
    Apr 2005
    Location
    Pennsylvania, USA
    Posts
    520
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Are the service files defined? (i don't know any PHP so i can only suggest...) Second off, i don't think php supports running batch files on host or client computer. That way you can't just say "shutdown -f" and shut down the host or client.

Posting Permissions

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

We are the oldest retro gaming forum on the internet. The goal of our community is the complete preservation of all retro video games. Started in 2001 as EmuParadise Forums, our community has grown over the past 18 years into one of the biggest gaming platforms on the internet.

Social