Alan Beagley <[EMAIL PROTECTED]> wrote in message 
news:<[EMAIL PROTECTED]>...
> Well, yes, I can see it in Process Commander too, but I wanted
>something automatic so that I can just have an icon for a .CMD file
>(REXX or otherwise) that runs MDH.EXE first if it isn't running, but
>goes straight to MOZILLA.EXE if MDH is running already.

I think that system command 'pstat' is enough to see MDH.EXE is
running or not.
For instance:

/* Rexx Script to invoke MDH.EXE & Mozilla.exe */
/***** modify here to fit your environment *****/
directoryWhereMozillaExeIs  = 'f:\Warpzilla-nightly\bin'
/***********************************************/
procToCheck        = 'MDH.EXE'
procAlreadyRunning = 'FALSE'
rc = directory(directoryWhereMozillaExeIs)
procToCheck = strip(translate(procToCheck))
newQ = RxQueue('create')
rc = RxQueue('set', newQ)
'@pstat /C | rxqueue ' || newq
do until Queued() = 0
    parse pull lineBuffer
    po = pos(procToCheck, lineBuffer)
    if po <> 0 then procAlreadyRunning = 'TRUE'
end
rc = RXQueue('delete', newQ)
if procAlreadyRunning = 'FALSE' then do
    'detach MDH.EXE'
end
/* 'start Mozilla.exe' */ /* I prefer this way but..*/
'Mozilla.exe'
return 0
/* end of Rexx Script */


This script requires:
1. 'pstat' is on path.
2. mozilla.exe and mdh.exe is on a directory where
   'directoryWhereMozillaExeIs' points.

-- 
Achain

Reply via email to