Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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

In reply to Re: Perl process names on Windows by Albannach
in thread Perl process names on Windows by monktim

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2023-03-30 07:54 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (74 votes). Check out past polls.