Something that WinTasks 4 Pro offers is scripting. Now, I must admit that I am a bit sceptical about this feature -- one mistake in the logic of the scripting, and you can end up in trouble. The manual for this chapter is a bit too basic and seems to contain a few mistakes and/or omissions which must be erroneous in nature. In any case, this did not bode well.
The upside is that the "language" used in the scripting is VBScript, so anyone can learn how to do it in about 30 minutes.
Editing scripts in WinTasks Pro
The scripting routine runs contiuously (as long as WinTasks is running) and will, for all intents and purposes, trigger instantaneously should a condition in one of your scripts apply (such as memory usage being over 75%).
Attempting to make my own scripts
I figured I would try and make a few scripts. One was that whenever I started the Windows Media Player (wmplayer.exe), I wanted the "ghclient.exe" task killed. After several attempts, I could not make this happen, as the "stop" command in the scripting language only stops the "current" process -- but no matter how I formulate the script, which application I start first or last, the process it killed, on two machines without fail was "wmplayer.exe". So, as soon as I opened up the Windows Media player, the process was killed. This strikes me as a serious bug in the logic behind how the scripting is implemented. You should definitely be able to declare which process should be killed, not just the current process, which for all intents and purposes is arbitrary.
I encountered more problems when trying to configure the system to start "ghclient.exe" as soon as the CPU load on the workstation falls below a certain level and "ghclient.exe" or "filter.exe" are not running. It seems that I cannot ascertain the total CPU usage, only the usage of a process. As the process doesn’t yet exist, I find myself somewhat lost.
As far as any really cool uses I came up with for scripting, this part of the application fell woefully short of my requirements.
Before anyone thinks that the scripting is totally useless, let me point out that if you want to modify an existing process based on memory usage or CPU usage, then this program will do that for you very well indeed. This means that I, as a web-developer, found one extremely good use for this scripting tool, namely catching IE6 crashes. Once in a while I get things wrong and IE6 ends up using some 90% CPU and fills the memory up like a bat out of hell. This can easily be caught using WinTasks' scripting and it can kill the run-away process.
Important note: If you make a script to start another process based on an already running process, you must ensure that your logic is sound before enabling it. If not, you can end up starting hundreds of instances of, for example "notepad.exe", per second if your machine is fast enough.
In my opinion a number of additions need to be made to the scripting in order to make it really worth using:
- Need to be able to monitor the total CPU Usage
- Need to be able to monitor the total memory usage
- Need to be able to select which task/process to kill, somehow
- The manual needs to correct the errors, especially in the examples, possibly needs to supply more examples.