Process Management in windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rick Westmacott

    Process Management in windows

    All I need to do is run a windows batch file from a small php program, and
    return the windows process id of the batch file. I have played around with
    proc_open() but that returns a resource id. Does anyone have a suggestion
    on what call I could use to get the windows process id returned within my
    program. I am using windows xp pro, and php 5/apache

    Thanks

    Rick


  • Simon Stienen

    #2
    Re: Process Management in windows

    Rick Westmacott <r_westmacott@h otmail.com> wrote:[color=blue]
    > All I need to do is run a windows batch file from a small php program, and
    > return the windows process id of the batch file. I have played around with
    > proc_open() but that returns a resource id. Does anyone have a suggestion
    > on what call I could use to get the windows process id returned within my
    > program. I am using windows xp pro, and php 5/apache
    >
    > Thanks
    >
    > Rick[/color]

    At least in PHP4 there was a php_w32api (or similar), which allows you to
    access winapi functions directly. Then look for a suitable function in the
    MSDN/any tutorial/elsewhere which you can call through the winapi.

    Anyway, php_w32api nearly completely sucked on my system (~1 year ago)...
    For some strange reason, the maximum of possible calls to the winapi was
    TWO! (Either two functions or one function twice.)
    Further at that time the official manual on php_w32api was unusable, too,
    but Google found a nice function description list.

    You could give it a try, but if didn't improved a lot since then, you
    shouldn't expect too much.
    --
    Simon Stienen <http://dangerouscat.ne t> <http://slashlife.de>
    »What you do in this world is a matter of no consequence,
    The question is, what can you make people believe that you have done.«
    -- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle

    Comment

    • Chung Leong

      #3
      Re: Process Management in windows


      "Rick Westmacott" <r_westmacott@h otmail.com> wrote in message
      news:uxH6d.2340 $Yr.462@newsrea d3.news.pas.ear thlink.net...[color=blue]
      > All I need to do is run a windows batch file from a small php program, and
      > return the windows process id of the batch file. I have played around[/color]
      with[color=blue]
      > proc_open() but that returns a resource id. Does anyone have a suggestion
      > on what call I could use to get the windows process id returned within my
      > program. I am using windows xp pro, and php 5/apache
      >
      > Thanks
      >
      > Rick
      >[/color]

      Try using tasklist.exe.


      Comment

      • Rick Westmacott

        #4
        Re: Process Management in windows

        Thanks,

        I knew of tasklist, but I need to trap the process id when each batch file
        starts. I will have many process of the same name running, and wouldn't
        know which one to kill. Im thinking of trying out winbatch which can
        apparently do anything. We'll see...

        Rick

        "Chung Leong" <chernyshevsky@ hotmail.com> wrote in message
        news:yO2dnTRZlP 83CMHcRVn-uA@comcast.com. ..[color=blue]
        >
        > "Rick Westmacott" <r_westmacott@h otmail.com> wrote in message
        > news:uxH6d.2340 $Yr.462@newsrea d3.news.pas.ear thlink.net...[color=green]
        >> All I need to do is run a windows batch file from a small php program,
        >> and
        >> return the windows process id of the batch file. I have played around[/color]
        > with[color=green]
        >> proc_open() but that returns a resource id. Does anyone have a
        >> suggestion
        >> on what call I could use to get the windows process id returned within my
        >> program. I am using windows xp pro, and php 5/apache
        >>
        >> Thanks
        >>
        >> Rick
        >>[/color]
        >
        > Try using tasklist.exe.
        >
        >[/color]


        Comment

        Working...