>
Does Server 2003 offer a dos command line utility
called Tasklist.exe ?
If so give it a run and see if it tells you who is
running which process. Then see if the process you're
looking for is running under a unique username (or
if that's the only time that user is running something
then that must be it).
You can redirect the output to a file using VBScript
and then inspect the contents of the file.
For instance I have XP Pro, and use Task Scheduler to run
an AutoHotkey script every 2 hours for reminders. There's
also another AutoHotKey script running 24x7, so if I use
TaskList.exe I can see if there are 1 or 2 running. If
it's running a specific program, then you may not need
to know who is running it, etc, etc.
Anyway give it a shot. Here's what I get on my pc...
Code:
c:\Program Files\MySQL\bin> tasklist | sort
========================= ====== ================ ======== ============
alg.exe 3044 Console 0 3,580 K
apache.exe 1944 Console 0 23,300 K
apache.exe 2920 Console 0 26,220 K
ashDisp.exe 376 Console 0 7,556 K
ashMaiSv.exe 312 Console 0 2,068 K
ashServ.exe 1836 Console 0 49,700 K
ashWebSv.exe 1492 Console 0 65,796 K
aswUpdSv.exe 1788 Console 0 244 K
ati2evxx.exe 1208 Console 0 2,916 K
ati2evxx.exe 1536 Console 0 3,724 K
AutoHotkey.exe 2604 Console 0 5,692 K
BCMWLTRY.EXE 1780 Console 0 8,376 K
cidaemon.exe 364 Console 0 588 K
cidaemon.exe 5276 Console 0 792 K
cisvc.exe 2032 Console 0 236 K
CLI.exe 640 Console 0 6,704 K
CLI.exe 5304 Console 0 5,216 K
cmd.exe 1960 Console 0 2,772 K
You can redirect the contents to a file, then read
the contents of the file into a variable, then check
the variable to see if the task or .exe or whatever is
running...
Something like:
Code:
dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
' run the command and redirect
WshShell.Run "cmd /c tasklist.exe |sort > tlist.txt", 2, True
'
dim f,fso,Filename
Filename = "tlist.txt" ; use path if necessary
Set f = fso.OpenTextFile(FileName, ForReading, True)
' read the entire contents into a variable...
FileText = f.ReadAll
' all done close the file
f.close
check contents of variable using INSTR() function for
your exe...
See if that works. Some OS don't have tasklist, steal one
from a friendly XPer!
>