troubleshooting Question

VB script to remotely query a service and restart if nessesary

Avatar of wibblar
wibblar asked on
Visual Basic.NET
2 Comments1 Solution280 ViewsLast Modified:
I'm trying to get into VB scripting and would like to create a tool that will remotly query a service and then attempt to restart that service if it is not running. (this is in an XP SP2 ,moving to SP3 and W2k3 server environment)

How would I run a Dos command from Vb and pull the error code back to VB

SC \\%servername% query %servicename%|findstr /i "running"

Or is there a better way to do this with purely VB?

Thanks in advance
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros