Possible to check to see if Windows process is running from PHP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wrybread@gmail.com

    Possible to check to see if Windows process is running from PHP?

    I need to check the state of a processes from within a PHP script on a
    Windows machine. All I need to know is whether or not the process
    exists (i.e., is running). Anyone have any ideas?

    I searched the archives and found proc_open(), but if it can do what
    I'm trying to do, I can't figure out how.

  • Chung Leong

    #2
    Re: Possible to check to see if Windows process is running from PHP?

    <wrybread@gmail .com> wrote in message
    news:1108937050 .288502.91410@o 13g2000cwo.goog legroups.com...[color=blue]
    > I need to check the state of a processes from within a PHP script on a
    > Windows machine. All I need to know is whether or not the process
    > exists (i.e., is running). Anyone have any ideas?
    >
    > I searched the archives and found proc_open(), but if it can do what
    > I'm trying to do, I can't figure out how.
    >[/color]

    Google for tlist.exe (pre-XP) or tasklist.exe (XP).


    Comment

    • Andy Hassall

      #3
      Re: Possible to check to see if Windows process is running from PHP?

      On Mon, 21 Feb 2005 00:27:20 -0500, "Chung Leong" <chernyshevsky@ hotmail.com>
      wrote:
      [color=blue]
      ><wrybread@gmai l.com> wrote in message
      >news:110893705 0.288502.91410@ o13g2000cwo.goo glegroups.com.. .[color=green]
      >> I need to check the state of a processes from within a PHP script on a
      >> Windows machine. All I need to know is whether or not the process
      >> exists (i.e., is running). Anyone have any ideas?
      >>
      >> I searched the archives and found proc_open(), but if it can do what
      >> I'm trying to do, I can't figure out how.
      >>[/color]
      >
      >Google for tlist.exe (pre-XP) or tasklist.exe (XP).[/color]

      There's also some goodies here that may be of use:



      (And various other useful tools on that site)

      --
      Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
      <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

      Comment

      • wrybread@gmail.com

        #4
        Re: Possible to check to see if Windows process is running from PHP?

        Thanks so much, that pslist did the trick perfectly.

        Comment

        • alanbe

          #5
          Re: Possible to check to see if Windows process is running from PHP?

          >>I need to check the state of a processes from within a PHP script on
          a[color=blue][color=green]
          >>Windows machine. All I need to know is whether or not the process
          >>exists (i.e., is running). Anyone have any ideas?[/color][/color]
          [color=blue][color=green]
          >>I searched the archives and found proc_open(), but if it can do what
          >>I'm trying to do, I can't figure out how.[/color][/color]


          Curious. Why do you need to do this?
          What processes runnng in Windows are you interested in?

          Comment

          • wrybread@gmail.com

            #6
            Re: Possible to check to see if Windows process is running from PHP?

            I built a photobooth, and PHP does the scripting. So the PHP script
            (running in Windows) tells a program called PSRemote to take 4
            pictures, then PHP passes the pictures to a Photoshop droplet to
            arrange them in a strip, then prints them, then the PHP script uploads
            the pics.

            The problem is, if someone clicked the button to take more pics while
            the script was running, it would crash. So a kludgey solution was to
            check if the processes php.exe was running, and if so abort. In essence
            I'm preventing multiple instances of the script.

            Here's the photobooth, if you're interested:



            Comment

            Working...