Check if Windowsservice is running

RaoulVB

Member
Joined
Nov 14, 2005
Messages
5
Programming Experience
Beginner
Hi all,

I just begun programming and i have a task to finish for my firm.

I write a programm, that first checks if it has windows xp runnig if not -> error.. then starting a dialer and at&t client, all works fine but i don´t know how to check the "sharedaccess" service ..

which commands or namespaces i have to use to check if a service exists/is active or running or off?

I don´t need ready code, i want to do it by myself, but i can´t get the whole system.ServiceProcess -> is it rigt or is there a other possibility to get the servicestatusinformation?

with a simple batchprogramming with runas it´s not a problem but i need it in visiual studio (vb.net)

I need the namespace and maybe the needed commands


some help would be nice...

and again : DON`T need whole code just a commandline or two to see how its working


greetings

Raoul VB
 
jmcilhinney said:
You would use a ServiceController component, available from the Toolbox.

oh boy.. thats so easy and i don´t find it.. ;-) ok now i got something to work with.. thx alot


greets RaoulVB
 
Hello again!


how i activate the window of a external program?

my program starts the external prog and i want, that after that this window is focused

can someone help?

thanks and kind regards


RaoulVB
 
Back
Top