Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.