473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Querying Service Control Manager (C#)

Hi ,

Any idea regarding which class to use for querying the SCM and get
various details , i actually want to build up a tool for accomplishing
various taska of mine rather than doing them manually .

Just for information "System.ServiceProcess.Servicecontroller" class is
not what i am searching for , as that is something that can be mapped to
each individual service in SCM to carry out some tasks , but i first
want to query the console to get various details .

I think it must be some WMI class , but not very sure .

any pointers will be good .

thanks ,

Mrinal
Nov 17 '05 #1
2 7501
Mrinal,

You have two options here. The first is like you said, WMI (using the
Win32_Service class). The second is to make the calls to the various
service control functions through the P/Invoke layer.

What kind of information are you trying to get?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mrinal Kamboj" <mr***********@oracle.com> wrote in message
news:9l**************@news.oracle.com...
Hi ,

Any idea regarding which class to use for querying the SCM and get various
details , i actually want to build up a tool for accomplishing various
taska of mine rather than doing them manually .

Just for information "System.ServiceProcess.Servicecontroller" class is
not what i am searching for , as that is something that can be mapped to
each individual service in SCM to carry out some tasks , but i first want
to query the console to get various details .

I think it must be some WMI class , but not very sure .

any pointers will be good .

thanks ,

Mrinal

Nov 17 '05 #2
Hi Mrinal,

Thanks for your post.

I am not sure what exact function you want to get. The Win32 Services API
is documented in the link below:
http://msdn.microsoft.com/library/de...us/dllproc/bas
e/service_functions.asp

Which function you want to get in .Net? "Nicholas Paldino [.NET/C# MVP]"
has provided the correct WMI class: Win32_Service. If you want to use the
second option: using Win32 API, I want to add some more information. In
Net, some of the Win32 Services API functions is implemented in .Net, we
may get the Win32 API to .Net class map in the article below:
"Microsoft Win32 to Microsoft .NET Framework API Map"
http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/win32map.asp

You may get the services function map in "Service Functions" section. For
other services API that is not documented in this link, I think we have to
P/invoke to use it.

Hope this helps.
==================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Russ McDaniel | last post by:
Originally posted to microsoft.public.dotnet.distributed_apps with no response. Reposted here with additional thoughts. --- Hello, I'm writing a Windows service which performs some...
6
by: Greg | last post by:
I am working on a project that will have about 500,000 records in an XML document. This document will need to be queried with XPath, and records will need to be updated. I was thinking about...
7
by: Steve Long | last post by:
In writing a Windows service with .NET, I'm noticing that the process for some services can not be killed with specifically stopping the service. If you try to kill the process with, say task...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
3
by: Chris Wagner | last post by:
Anyone knows how to install/unistall service with VB.NET without using InstallUtil program? Thanks
2
by: letibal | last post by:
Hello, I have written a windows service and created an installer for it. The service runs under the system accounts. When started, it launches a GUI. By default, the InteractiveProcess property...
4
by: Jianwei Sun | last post by:
Hi, all, I have a question, and I hope to get some hints here.. I created a really simple service just to check why the service manager doesn't start my service the second time if the first...
13
by: dancer | last post by:
I have made a new post because when I try to respond to another, I get the error, "Article Rejected -- Ill-formed message id" This is in response to the advice of Juan Libre to install Net...
2
by: Steven Cheng [MSFT] | last post by:
Hi Cj, I also noticed that the "Act" variable here seems hasn't been declared(or declared anywhere else?). I've try building the same code and got the same result and the "Operator '+' cannot be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.