In the process of finding and fixing that bug, I replaced the Collection mechanism with the augmented Collection supplied by the "Class Builder" add-in.
The source code is essentially the same as before but with a few changes. First the
Varclasses. (The comments are predominantly those supplied by the add-in.)
Next, Vars.cls (it's tiny but it could hold so much more):
Now the main module. The first thing that is different here, is that
nLevelis now a
Integerdoesn't handle the
ABOVENORMAL_PRIORITYvalue without complaint.
Next change is removing the reference to
Collection, changing it to
SysVarsand setting up the values.
The benefit of using SysVars and that approach to the Collection object is that we now have an
.Existsmethod, so we now have a tidier way of setting
nLeveland trapping invalid settings thereof.
All the other routines are as before.
I haven't gotten around to extending this tool to do stuff to remote computers. It's not hard; killing a process on another machine means another value for
KillProcess, and, of course, the relevant privilege level.
© Copyright Bruce M. Axtens, 2008