Catch pid for a process that created

Discussion in 'Perl' started by Mav, Aug 3, 2004.

  1. Mav

    Mav Guest

    Hi,
    I am writing a perl script on windows that try to get the pid for a
    program that created another processes.

    ......

    @args = ("\"$devPath\\devenv.com\" ..\\Solution\\My.sln /build
    Debug");
    $pid = open my $proc, "@args |";
    ....


    the $pid will give me the pid for devenv.com; However, the devenv.com
    actually created another process name devenv.exe, is that a way I can
    get that pid.

    Thanks,
    Mav
     
    Mav, Aug 3, 2004
    #1
    1. Advertising

  2. Mav

    lxrocks Guest

    Mav wrote:
    > Hi,
    > I am writing a perl script on windows that try to get the pid for a
    > program that created another processes.
    >
    > .....
    >
    > @args = ("\"$devPath\\devenv.com\" ..\\Solution\\My.sln /build
    > Debug");
    > $pid = open my $proc, "@args |";
    > ...
    >
    >
    > the $pid will give me the pid for devenv.com; However, the devenv.com
    > actually created another process name devenv.exe, is that a way I can
    > get that pid.
    >
    > Thanks,
    > Mav

    Don't know much about windows, but try the Win32::ToolHelp module.
    It can provide process information.

    http://search.cpan.org/~prantl/Win32-ToolHelp-0.2/ToolHelp.pm
     
    lxrocks, Aug 12, 2004
    #2
    1. Advertising

  3. Mav

    Mav Guest

    lxrocks <> wrote in message news:<kMFSc.53113$>...
    > Mav wrote:
    > > Hi,
    > > I am writing a perl script on windows that try to get the pid for a
    > > program that created another processes.
    > >
    > > .....
    > >
    > > @args = ("\"$devPath\\devenv.com\" ..\\Solution\\My.sln /build
    > > Debug");
    > > $pid = open my $proc, "@args |";
    > > ...
    > >
    > >
    > > the $pid will give me the pid for devenv.com; However, the devenv.com
    > > actually created another process name devenv.exe, is that a way I can
    > > get that pid.
    > >
    > > Thanks,
    > > Mav

    > Don't know much about windows, but try the Win32::ToolHelp module.
    > It can provide process information.
    >
    > http://search.cpan.org/~prantl/Win32-ToolHelp-0.2/ToolHelp.pm


    That will give me the process devenv.com, but I still cannot get the
    devenv.com. The problem I have is when I start my script that will
    call devenv.com, however, the devenv.com will call devenv.exe, If I
    using Ctrl-C to
    stop (or install my SIG handler), I can only kill devenv.com, which
    will leave the devenv.exe still running.

    Any suggestion?
     
    Mav, Aug 20, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sigal

    Process PID

    Sigal, Feb 18, 2004, in forum: Perl
    Replies:
    1
    Views:
    718
    Sigal
    Feb 18, 2004
  2. walker

    how can get other process pid

    walker, Nov 24, 2003, in forum: C Programming
    Replies:
    0
    Views:
    320
    walker
    Nov 24, 2003
  3. walker

    how can get other process pid

    walker, Nov 24, 2003, in forum: C Programming
    Replies:
    0
    Views:
    285
    walker
    Nov 24, 2003
  4. P.S.
    Replies:
    0
    Views:
    339
  5. Miki Tebeka
    Replies:
    2
    Views:
    624
    Chris Angelico
    Apr 8, 2011
Loading...

Share This Page