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.

Currently, we have setup a .BAT file which lists all services to start / stop them eg.

SC start SERVICE
SC start SERVICE

SC stop SERVICE
SC stop SERVICE

We add new services all the time and the list grows and is difficult to maintain the batch file.

Is it possible to use a WILDCARD like 'SC start SERVICE*' or something?

share|improve this question
    
What windows version? –  Endoro Apr 24 '13 at 15:22

1 Answer 1

You can use wmic and SQL-ish wildcard syntax.

From a cmd console:

wmic service where "name like 'SERVICE%'" call startservice

From a .bat script:

wmic service where "name like 'SERVICE%%'" call startservice

Available verbs include startservice, stopservice, pauseservice, resumeservice, and others. Do wmic service call /? for more info.

share|improve this answer
1  
The query language is called WQL, BTW. It's a subset of SQL. –  Bob Apr 25 '13 at 17:58
    
@Bob - Oh. Ya learn something new every day. :> –  rojo Apr 25 '13 at 17:59

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.