Catch pid for a process that created

M

Mav

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
 
L

lxrocks

Mav said:
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
 
M

Mav

lxrocks said:
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top