a little help please

Posted on 2013-10-03
Medium Priority
Last Modified: 2013-10-03
New to the experts exchange, please forgive my ignorance.  I was looking at the response to question Q_24494363 by Lee025 and solved by rejoinder - HTA with VBScript sot stop/start windows services.

This is what I am looking for but - I want to only look up one (1) service and not all of the services.  I am not proficient enough in vbscript to know what to change.  Can someone please let me know what/how to change the script to only look for a single instance of a service?

Thank you,
Question by:2infuze
  • 2
  • 2
LVL 65

Accepted Solution

RobSampson earned 2000 total points
ID: 39545031
Hi, all you will need to change is this line:
    Set colItems = objWMIService.ExecQuery("Select * from Win32_Service")

Open in new window

to this:
    Set colItems = objWMIService.ExecQuery("Select * from Win32_Service Where Name='spooler'")

Open in new window

where 'spooler' is the name of the service you want to check.



Author Comment

ID: 39545069
Yes.  That worked exactly as I wanted.  I'm getting a little better at vbscript.  Thank you.

Author Closing Comment

ID: 39545073
Just what I was looking for and wanted it to do.  Fantastic response and solution.  Thank you.
LVL 65

Expert Comment

ID: 39545116
No problem.  Thanks for the grade.


Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question