Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2001-06-25
12
Medium Priority
?
930 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

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 accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

730 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