Thanks for the quick response. What I have done is create a vbscript that looks for Procomm and loops until pw4.exe is terminated. I thought I'd post it so anyone can use it. I placed it in my job list as task 1 for each job that i use Procomm on.
the pname variable contains the process name.
=====
const timeout=300000 'in millisecond
const timepoll=500 'in millisecond
'The Process for ProComm
pname = "pw4.exe"
WScript.Echo "Starting at " & Now
Set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='" & pname & "'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count 'it can be more than 1
if iniproc=0 then
wscript.echo "The process " & pname & " is inexistent. Continueing script."
set cproc=nothing : set svc=nothing
wscript.quit(0)
end if
set cproc=nothing
for i=0 to timeout\timepoll
set cproc=svc.execquery(sQuery)
if cproc.count=0 then 'this monitor all instances died out
wscript.echo "All processes of " & pname & " are now terminated at " & Now
WScript.Echo "Continueing"
exit for
else
if i=timeout\timepoll then
wscript.echo "Some process " & pname & " is still running within the timeout period."
else
wscript.sleep timepoll
end if
end if
next
set cproc=nothing
set svc=nothing
=====
Thanks again for all yourt help.
Craig Hindall
EDI Analyst
Zotec Partners
Edited by user
2009-11-03T14:15:09Z
|
Reason: Not specified