in reply to Re: caller of perl script
in thread caller of perl script

Here's a somewhat easier way:

#! perl -slw use strict; use Win32::Process::Info;; my $pi = new Win32::Process::Info;; my @info = $pi->GetProcInfo( $$ ); my $ppid = $info[0]{ ParentProcessId }; @info = $pi->GetProcInfo( $ppid ); print "Parent process name : ", $info[0]{ ExecutablePath }; print "Command line: ", $info[0]{ CommandLine };

But as I explained earlier, it's not very useful for the OPs stated requirement as it always gives the same information:

c:\test>type junk.bat dad c:\test>junk.bat c:\test>dad Parent process name : C:\Windows\System32\cmd.exe Command line: "C:\Windows\System32\cmd.exe"

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy