Solved

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

Posted on 2001-06-25
12
923 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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