Solved

How to open Services window using a shell command in NT?

Posted on 2001-06-25
12
917 Views
Last Modified: 2013-12-03
How to open Services window using a shell command in NT?
Iam able to open the Services Window on the fly in Win2000
by Using ShellExecuteCommand but not able to open the Services in WinNT .Is there any other solution to open the Services Window on the fly in WinNT.....????
This senario is being used during installation process that i am writing for my project using installshield.
Can any one help me?
Thanks in advance.


0
Comment
Question by:gvsbnarayana
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 9

Expert Comment

by:ShaunWilde
Comment Utility
try this

ShellExecute(NULL,"cplopen","c:\\winnt\\system32\\srvmgr.cpl","Services",NULL,SW_SHOWNORMAL);
0
 
LVL 8

Author Comment

by:gvsbnarayana
Comment Utility
hi ShaunWilde ,
this is working fine..thanks a lot but is there any way to open the services window, independent of the system..... in both Windows 2000 and Win NT
0
 
LVL 32

Expert Comment

by:jhance
Comment Utility
>>independent of the system

What do you mean by that?

The services control panel is a Windows DLL and it needs to be loaded and run by something.  You can load the srvmgr.cpl file yourself with LoadLibrary() and call the exports yourself but the ne effect would be the same.

If you want to control services directly, you have the Service Control Manager (SCM) API functions at your disposal.  See OpenSCManager() and it's "friends".
0
 
LVL 8

Author Comment

by:gvsbnarayana
Comment Utility
hi ShaunWilde ,
this is working fine..thanks a lot but is there any way to open the services window, independent of the system..... in both Windows 2000 and Win NT
0
 
LVL 32

Expert Comment

by:jhance
Comment Utility
>>independent of the system

What do you mean by that?

The services control panel is a Windows DLL and it needs to be loaded and run by something.  You can
load the srvmgr.cpl file yourself with LoadLibrary() and call the exports yourself but the ne effect
would be the same.

If you want to control services directly, you have the Service Control Manager (SCM) API functions at
your disposal.  See OpenSCManager() and it's "friends".
0
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 200 total points
Comment Utility
> in both Windows 2000 and Win NT

I couldn't say - I created the above solution by looking in the registry and seeing what the comands are for 'cplfile'

what does 2000 say - I don't have it here so i couldn't check - but it is quite common for code to check the os before performing an operation

eg

if (IsNT4)
... // do NT4 stuff
else if (IsNT2000)
... // do NT2000 stuff

0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 9

Expert Comment

by:ShaunWilde
Comment Utility
just had a look on a 2000 machine and it seems that they have implemented services as a MMC (microsoft management control)
0
 
LVL 32

Expert Comment

by:jhance
Comment Utility
Is it possible for you to explain in greater detail what you are trying to accomplish here?
0
 
LVL 8

Author Comment

by:gvsbnarayana
Comment Utility
i am writing a setup program for my product!! I want to stop in the IIS services and the other services in the middle of the setup program and it's taking a long time if i do it through programme and i wanted the user to make sure that he accepts to stop the services for a while.. so i want to populate the Services window and let him stop the service on his own.
that is working fine in Win 2000 but i am not able to do it in Windows NT 4.0 Server!!!
How can you we that?
Thanks in advance
0
 

Expert Comment

by:amp072397
Comment Utility
gvsbnarayana:

Kindly return to and resolve this old question.

thanks!
amp
community support moderator
0
 
LVL 8

Author Comment

by:gvsbnarayana
Comment Utility
Thank you Mr. oShaunWilde ,
Your suggestion helped me !!
Please take your points!!
and
All people who tried to solved my problem,
Thank you very much for spending time to solve my problem and Sorry for the late in closing the question!!.

Regards,
Badri
0
 
LVL 8

Author Comment

by:gvsbnarayana
Comment Utility
Thank you Mr. oShaunWilde ,
Your suggestion helped me !!
Please take your points!!
and
All people who tried to solved my problem,
Thank you very much for spending time to solve my problem and Sorry for the late in closing the question!!.

Regards,
Badri
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now