Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2001-06-25
12
Medium Priority
?
932 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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 600 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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 anti-spam), the admin…

879 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