Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8468185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:51:41+00:00 2026-06-10T15:51:41+00:00

I want to fetch all service_name and its status without using any 3rd party

  • 0

I want to fetch all service_name and its status without using any 3rd party tool. So far SC command was good enough to fetch one of the values, something like

sc query | findstr SERVICE_NAME

but I also need STATUS for each SERVICE_NAME listed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:51:42+00:00Added an answer on June 10, 2026 at 3:51 pm

    Here’s a command that should do the job:

    for /f "tokens=2" %s in ('sc query state^= all ^| find "SERVICE_NAME"') do
        @(for /f "tokens=4" %t in ('sc query %s ^| find "STATE     "') do @echo %s is %t)
    

    How it works:

    First sc query state= all | find "SERVICE_NAME" is run. This command is designed to give you the service names, one per line. The carets ^ (which I have removed here) are necessary in order to escape the special characters that you want to affect the sc command and not the for command itself.

    Then the initial for /f parses the above output to remove the standard “SERVICE_NAME:” prefix from each line, giving you pure service names. At this point the output looks like this:

    C:\>for /f "tokens=2" %s in ('sc query state^= all ^| find "SERVICE_NAME"') do @echo %s
    AdobeFlashPlayerUpdateSvc
    AeLookupSvc
    ALG
    AppIDSvc
    Appinfo
    AppMgmt
    aspnet_state
    AudioEndpointBuilder
    AudioSrv
    

    This output is then fed to the next for /f, which runs sc query servicename, finds the line with the state, and isolates the 4th “word” (the current state).

    Finally, the name of each service is printed along with its state (at this point you can choose to do something different if you wish).

    Important note: If you run this inside a batch file, the percent signs (e.g. at %s) need to be doubled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i Want to fetch this data using json decode. Please Help.. So far i
I just want to fetch all tweets of an specific twitter account. I want
one Article has many Comments, and i want to fetch all Articles that have
My query is essentially the following: entries=Entry.all().order(-votes).order(-date).filter(votes >, VOTE_FILTER).fetch(PAGE_SIZE+1, page* PAGE_SIZE) I want to
I want fetch last record using hibernate criteria Can u help me?
I want to fetch all the records that have null in openingbalance field of
I am writing a chrome extension where I want to fetch all the images
I want to fetch all the objects from an entity which has no related
I want to fetch all wiki category ids, category names ans parent category ids.
In a Rails application I want to fetch all users, ordered by their count

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.