Somebody may well prove me wrong on this, but I am unaware of any mechanism for changing the image name of a running Win32 process.
The best suggestion I have is that you create a renamed copy of perl.exe for each application and a .cmd file with the same name that runs the appropriate .pl file using the appropriately named .exe. The executable is only ~40kb, so the space requirements are minimal. By placing the .cmd file (or a .bat create with pl2bat.pl with edits), in the path, you will be able to run yourapp.pl using the command line yourapp which will run yourapp.cmd, which will run yourapp.exe yourapp.pl.
Not elegant, but simple to arrange, with minimal requirements, and it achieves the aim of having different names appear in the tasklist, whilst allowing each of those executables to share the majority of runtime ram because they would share the one instance of perl5x.dll.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
It is not apparent that there is any way to set the Image Name. There is nothing passed into CreateProcess that seems related to the image name that is shown and there are no API functions that I can see that would allow you to change the image name once created - very likely that is by design!
However if you look at the Applications tab rather than the Processes tab you may find that the names of things are more to your liking. For GUI apps you may find it helps to use wperl.exe rather than perl.exe to run your applications.
This all assumes a context of Windows and, for wperl, ActiveState Perl of course.
DWIM is Perl's answer to Gödel
| [reply] |
This all assumes a context of Windows and, for wperl, ActiveState Perl of course
I think wperl.exe will be part of any properly built perl for Win32, irrespective of who built it or which compiler was used. (It's certainly part of my MinGW-built perl 5.8.8, which was built from the perl.org source.)
Cheers, Rob
| [reply] |
++ for "this is by design" ;)
| [reply] |
Perhaps you could convert the "long running apps" into Win32 SERVICEs. These have a lot more control, via registry keys, as to what they look like when running.
The Windows resource kid provides "srvany", which helps launch any command line app as a service.
"For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken
| [reply] |
I do not think you can do this.
But there is still hope! Using Process Explorer you can view the command line arguments to the process. (Go to the View menu and choose "Select Columns")
Presto, now you can easily tell which process is what.
| [reply] |