Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sc command output

Status
Not open for further replies.

zaznet

MIS
Jul 15, 2004
122
US
I am looking at the output from "sc" and want to know if I can get the "Startup Type" value from it. I mean "Manual" "Disabled" "Automatic" for a service.

Working on a script file and this info would be a nice bonus for my output file :)

Nathan aka: zaz (zaznet)
zaz@zaz.net
 
I was able to find what I needed. I used "qc" instead of "query". qc is "query config" so it tells me how the service or device driver is configured.

Short sample of how I used this in my CMD script.

for /f "tokens=3 delims=: " %%a in ('sc \\SRVR qc ServNam ^| find "START_TYPE"') do set VarType=%%a



Nathan aka: zaz (zaznet)
zaz@zaz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top