Link to home
Start Free TrialLog in
Avatar of samiam41
samiam41Flag for United States of America

asked on

List win 10 services (filter service_name and status) batch script

Hey Experts.  I've got a little in-house script that we use to gather system info on our PC's.  I'm trying to gather the service_name and status of the Windows services on the PC and echo those to a log file.

I've tried:  sc query type= service and sc query type= service | show/find/select service_name, state with no luck.

Need this to be a batch script so please limit suggestions to that coding language.  Thank you in advance.
Avatar of samiam41
samiam41
Flag of United States of America image

ASKER

sc query state= all |findstr "SERVICE_NAME STATE"

Both values together inside the " "
ASKER CERTIFIED SOLUTION
Avatar of samiam41
samiam41
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial