Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to detect the state of the Exchange VSS Writer service on a given machine. The script will only be executed if Microsoft Exchange 2003, 2007, or 2010 is currently running.

Powershell Script execution is not a viable option, as the client environments may or may not have script execution enabled.

Currently, I capture the output of running this command:

cmd /C "vssadmin list writers | find "Microsoft Exchange Writer" | find "State"

and if the state is set, return true.

This is always return true, because the first find only returns a single line.

share|improve this question
Basically I need to get trailing lines to "Microsoft Exchange Writer"... Anyone know any flags/options/regex so I can grab trailing lines in the Find command? – Joe Aug 1 '12 at 18:34
I think this can be done with some combination of findstr instead of find. I am not currently finding any way to build a regex that spans multiple lines. Anyone have any clue on how to construct that? – Joe Aug 3 '12 at 19:13

You must log in to answer this question.

Browse other questions tagged .