in reply to How to get PID of a process given its complete command line in windows

Take a look at the Win32::Process::List module, it's probably all you need. Alternatively, you could get away with a simple

my @proc_lines = `tasklist`;

but then you would have to parse the lines for the relevant info yourself. Win32::Process::List does that already.

UPDATE: A small example from the module documentation:

use warnings; use strict; use Win32::Process::List; my $plist = Win32::Process::List->new(); my $pid = $plist->GetProcessPid("explorer");

- Luke

Replies are listed 'Best First'.
Re^2: How to get PID of a process given its complete command line in windows
by avj24 (Initiate) on Nov 10, 2014 at 15:55 UTC

    Windows tasklist command only has the image name of the process, not its complete commandline. There can many process with same image name. Also, the Win32::Process::List module has image name not the commandline of the process.