Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

How can I check which perl script is running in Windows?

by pijush (Scribe)
on Dec 25, 2003 at 11:39 UTC ( #316970=perlquestion: print w/replies, xml ) Need Help??

pijush has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks!

In unix box when a perl script is running then from the output of ps -ef I can easily determine the name of the perl script which is running (obviously, the path name of the perl script is short enough to see). But in case of windows when a perl script is running, only a Perl.exe is running. I have tried with both task manager and tlist, but both are showing only perl.exe is running.
How can I determine the perl script name which is currently running in Windows box?
Thanks in advance.
Regards
-Pijush

  • Comment on How can I check which perl script is running in Windows?

Replies are listed 'Best First'.
Re: How can I check which perl script is running in Windows?
by PodMaster (Abbot) on Dec 25, 2003 at 12:02 UTC
    You have a couple of choices:
    • create a custom perl binary (embed perl, easier on win32 than most), which does the neccessary mojo to show the script filename on win32
    • compile the script with pp
    • compile the script with perlbin (development of which is kind of stalled though, but it does work on win32)
    update: Heard of runperl.bat? Just write a compiled program to do this.
    update: or just modify runperl (add title perl %0) and it will show up in task manager under applications as perl "some/path.bat"
    update: http://www.sysinternals.com/ntw2k/freeware/procexp.shtml has the ability to show how perl was invoked (better than task manager).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      I also suggest proccess explorer from sysinternals ( the link at the end of PodMaster's post ). It allows you to see which filehandles each process has open, perl.exe is bound to have a filehandle on whatever script it is executing.

Re: How can I check which perl script is running in Windows?
by Theo (Priest) on Dec 25, 2003 at 23:09 UTC
    Isn't it also possible to compile a perl script? Then when it's run as an .exe it would show up just like any other executable.

    (but what do I know?)

    -Theo-
    (so many nodes and so little time ... )

Re: How can I check which perl script is running in Windows?
by pijush (Scribe) on Dec 26, 2003 at 11:10 UTC
    Hi Monks,

    Thanks PodMaster and all other monks who have replied so quickly. But in my case procexp is not suitable. First, I am telling what is my requirement. On a remote machine one perl script (say test.pl) is running and from another machine I want to detect whether test.pl is running or not on the remote machine.
    In this scenario how can I detect whether test.pl is running on remote machine or not ?
    I have not tried with par, but now I have started reading about it.
    One more query, in UNIX box I can detect whether test.pl is running or not using ps -ef|grep test.pl , but it takes time. Is there any way to detect it faster?
    Thanks in advance.
    -Pijush

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://316970]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2022-07-05 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?