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"
|
|---|