I have a windows EXE, which gives me some data. When I run this using my code below, two processes are created: One is cmd.exe and other is .exe which I am running. the $pid has PID of cmd.exe, Is there any way that I can have $pid the PID of .exe I am running.
Here is my code:
my $Command = abc.exe
my $pid = open ($fileHandler, '-|', "$Command 2>&1");
if ( ! defined $pid) {
die "Cannot Open Command\n";
}