mutley1
MIS
- Jul 24, 2003
- 909
Hi all,
I'm trying to get 3 bits of information onto 1 line of an output file and not sure if it is possible. I have a server name, a service name and am then running an sc query to obtain the status of the service. Obviously when you do sc \\SERVER query BLAH, there are several lines of text returned so I am using findsrt "STATE" to return the single line.
In the output file i want to see SERVER, SERVICE, STATE= (from sc command) on 1 line. I'm using echo to get the first 2 peices of info (hardcoded line by line but not a problem), but not sure how to get the output of sc on that line as well. It seems to be a problem with findstr as well.
Any ideas?
Cheers,
M.
I'm trying to get 3 bits of information onto 1 line of an output file and not sure if it is possible. I have a server name, a service name and am then running an sc query to obtain the status of the service. Obviously when you do sc \\SERVER query BLAH, there are several lines of text returned so I am using findsrt "STATE" to return the single line.
In the output file i want to see SERVER, SERVICE, STATE= (from sc command) on 1 line. I'm using echo to get the first 2 peices of info (hardcoded line by line but not a problem), but not sure how to get the output of sc on that line as well. It seems to be a problem with findstr as well.
Any ideas?
Cheers,
M.