The issue is what Microsoft considers a process.
To Quote MS:
Note
* A script is not equivalent to a process. Instead, each script runs in an instance of the scripting host process; each time you run a VBScript script, an instance of either Wscript.exe or Cscript.exe is started. If you start five scripts, the Task Manager lists five instances of Wscript.exe. It does not list the names of the individual scripts running in each of these processes.
End Quote
I know this is an issue with Java as well and I do believe there is a hack for java. (I think you end up recompling the JRE to get around this, by adding renaming code to the JRE, But I am not certain)
So your choices are a Major hack or doing as the frist responce said.
MADuran Who needs a spiffy sig
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
One potential solution: Use the format from the commandline: start "my title" perl myscript.pl, then use tlist (from the reskit) to view a listing, you can see the title you specified. Frankly its cumbersome, but you didn't define how "major" is a "major hack" :)
- jbWare | [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
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
| [reply] [Watch: Dir/Any] [d/l] [select] |
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.
| [reply] [Watch: Dir/Any] |