Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl process names on Windows

by Albannach (Prior)
on Feb 05, 2004 at 17:13 UTC ( #326810=note: print w/ replies, xml ) Need Help??


in reply to Perl process names on Windows

I'm lead to believe from what I've read that changing the actual Win32 process name would require a kernel-level driver hack, however if all you want is a nicer name in Task Manager, this works for me:

use Win32::Console; my $CONSOLE = new Win32::Console(); $CONSOLE->Title($0);
You might want to take the path off the $0 for a neater result however.

Update: Silly me, I was thinking of the "Applications" tab of Task Manager, which the above does affect, but of course you want the "Processes" tab to change for background processes, so I fall back on the first statement that there doesn't appear to be a way to do that. Even Microsoft gives examples of making multiple copies of EXE fles with different names in order to help organize the Processes tab information. Hmm, I guess you could have your script look for its own name in the process list, and if it doesn't exist, make a copy of PERL.EXE with its own name, and then re-run itself. Ugly.

--
I'd like to be able to assign to an luser


Comment on Re: Perl process names on Windows
Select or Download Code
Re: Re: Perl process names on Windows
by monktim (Friar) on Feb 05, 2004 at 17:27 UTC
    That didn't change the name in my Task Manager (Win 2K). It did change the title on the window that runs in the foreground. That can also be accomplished with the Windows title command. I'm running the scripts as background processes.

    Update: Thanks Albannach.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://326810]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2014-09-17 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (56 votes), past polls