Solved

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

Posted on 2001-06-25
12
919 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
ID: 6226664
try this

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

Author Comment

by:gvsbnarayana
ID: 6227071
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
ID: 6227139
>>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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 8

Author Comment

by:gvsbnarayana
ID: 6227319
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
ID: 6227329
>>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
ID: 6227612
> 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
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6228501
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
ID: 6231180
Is it possible for you to explain in greater detail what you are trying to accomplish here?
0
 
LVL 8

Author Comment

by:gvsbnarayana
ID: 6782647
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
ID: 6790945
gvsbnarayana:

Kindly return to and resolve this old question.

thanks!
amp
community support moderator
0
 
LVL 8

Author Comment

by:gvsbnarayana
ID: 7062516
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
ID: 7062530
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

815 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

9 Experts available now in Live!

Get 1:1 Help Now