Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

SERVICEMONITOR questions

May
12,957
172
Apparently you can't monitor for two conditions.

Code:
v:\> servicemonitor Everything started stopped forever v:\load_es.btm
Usage : SERVICEMONITOR [/C service] [service STARTED | STOPPED | PAUSED n command]

Can I have two SERVICEMONITORs?

More questions to come.
 
Last edited:
Using this BTM,

Code:
:: v:\load_es.btm
delay 1
iff %_servicestate == 2 .or. %_servicestate == 4 then
    d:\tc31\everything.exe -startup
    plugin /L d:\data\tccplugins\es\es.dll
    echo The plugin was loaded
endiff
unset /q _service*

I issued servicemonitor Everything started 1 v:\load_es.btm.

Then I issued sc start Everything.

The BTM was apparently run because the Everything client started (got a tray icon). But the plugin was not loaded and the message was not displayed.

Ultimately, I want to automatically start/stop the Everything client and load/unload the plugin when the Everything service starts/stops.

There will probably be more questions.
 
But the plugin was not loaded and the message was not displayed.
That one solved. The BTM was waiting for the Everything client to terminate (as a BTM should). Using START fixes that.

Handling both service start and service stop is still a problem.
 
Apparently you can't monitor for two conditions.

Code:
v:\> servicemonitor Everything started stopped forever v:\load_es.btm
Usage : SERVICEMONITOR [/C service] [service STARTED | STOPPED | PAUSED n command]

Can I have two SERVICEMONITORs?

You can only test one condition per SERVICEMONITOR command (as shown in the usage statement with the OR's).

You can have as many SERVICEMONITORs running as you want, up to the maximum monitoring limit (100 simultaneous monitors).

However, the SERVICEMONITOR states are not triggers. SERVICEMONITOR simply queries the services list to see if the process is currently STARTED, STOPPED, or PAUSED. (Not new, it's behaved this way for 20+ years.)
 

Similar threads

Back
Top