Status of an operating system service
Hey Guys.
Is possible i know in COS the state of the one service the operation system?
One example:
What's state of service WinDefend for example, in operating system Windows.
I would like to know the status of the service.
Figure out how you'd do it at a command prompt and then issue that command with $ZF(-1)
But, "$ZF(-1)" is not return result of execution command.
You see in documentation:
"$ZF(-1) does not return operating system command results"
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...
If the command you're using doesn't support redirection to a file use a command pipe
e.g.
SET $ZT="CommandErr"
OPEN Command:"QR"
FOR {
USE Command
READ Text
USE $P
; do something with the text
}
CommandErr ;
SET ZE=$ZE
SET $ZT=""
USE $P
CLOSE Command
IF $P(ZE,">")="<ENDOFFILE" {
; successful completion
}
ELSE {
; something happened
}
test.mac:
Result: