Results 1 to 5 of 5

Thread: [RESOLVED] List Services

  1. #1

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Resolved [RESOLVED] List Services

    I've been searching the forums and Internet and cannot find what I need. I want to list the services which are running on a machine. Actually, I don't need to list them all but some of them.

    I need to show the Display Name or the Service Name... but all the snippets that I found list the EXE name. Does anyone know how to do this? TIA
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: List Services

    Try this
    Code:
    'Set a reference to WMI Scripting
    
    Private Sub Command1_Click()
    Dim serviceset As Object
    Dim service As Object
    Set serviceset = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Service")
    
    For Each service In serviceset
        List1.AddItem service.Name & ":   " & service.Description
    Next
    End Sub
    Last edited by Hack; May 9th, 2007 at 11:24 AM.

  3. #3

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: List Services

    So close!! How do I get to know if the service is running or stopped?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  4. #4

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: List Services

    Found it!! It was service.state. Thank you, Hack!!
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: List Services

    You are welcome.

    If you consider this resolved, you could help us out by pulling down the Thread Tools menu and click the Mark Thread Resolved menu item. That will let everyone know that you have your answer.

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width