Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

start/stop services programatically

 
   Web Hosting and Web Master Forums (Home) -> IIS RSS
Next:  Webgarden\Woker Process\IIS 6.0\Multi-proc server  
Author Message
vickaiser1

External


Since: May 14, 2004
Posts: 3



(Msg. 1) Posted: Tue Jun 15, 2004 10:27 pm
Post subject: start/stop services programatically
Archived from groups: microsoft>public>inetserver>iis (more info?)

I am creating a setup project for an application and need to edit the
Metabase.xml file during setup. Does anyone know of a way to stop and
then restart services programatically before and after I edit this
file?

Vic

 >> Stay informed about: start/stop services programatically 
Back to top
Login to vote
anonymous131

External


Since: Oct 17, 2003
Posts: 720



(Msg. 2) Posted: Tue Jun 15, 2004 10:27 pm
Post subject: start/stop services programatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

net stop w3svc
net start w3svc

I am assuming your program is only going to run on IIS6
and Windows 2003.

doug

 >-----Original Message-----
 >I am creating a setup project for an application and
need to edit the
 >Metabase.xml file during setup. Does anyone know of a
way to stop and
 >then restart services programatically before and after I
edit this
 >file?
 >
 >Vic
 >.
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: start/stop services programatically 
Back to top
Login to vote
kgafvert

External


Since: Aug 23, 2003
Posts: 2972



(Msg. 3) Posted: Wed Jun 16, 2004 2:23 am
Post subject: Re: start/stop services programatically [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hello,

If you are using .NET, you can use:

ServiceController.Start()
ServiceController.Stop()

methods to start and stop a service.

For more information about these methods, please look them up in MSDN. You
have many other useful methods in the ServiceController class, and the
System.ServiceProcess namespace (where this class is located).


And as Doug said, you can also call "net stop" and "net start" to start and
stop services.

Hope this helps!


--
Regards,
Kristofer Gafvert - IIS MVP
<a style='text-decoration: underline;' href="http://www.ilopia.com" target="_blank">http://www.ilopia.com</a> - When you need help!


<vickaiser1.RemoveThis@yahoo.com> wrote in message
news:ccjuc01v5ud81g7hjonf1n2rhoj0brkhvo@4ax.com...
 > I am creating a setup project for an application and need to edit the
 > Metabase.xml file during setup. Does anyone know of a way to stop and
 > then restart services programatically before and after I edit this
 > file?
 >
 > Vic<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: start/stop services programatically 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
IIS4 web and ftp services stop responding. HELP - We host 2 websites and an FTP site. Over the past couple of weeks these services will stop responding. If you go the Internet Service Manager it says that the sites are running, but they will not respond. The websites will say page not found and the ftp....

can't start/stop IIS 5 on XP Pro - I've screwed something up as things used to be working fine. For some reason, I am unable to access my localhost. When I open the IIS snap-in my computer is listed, but nothing else. I can't browse it, nor can I stop or start the service. When..

Stop all IIS and related services on Win2000 server - We are required to disable, stop IIS on servers unless it is a webserver, which mine is not. I unchecked iis when installing and the service is still running. How do I stop service without causing errors?

WWW and FTP Services won't start - I am running NT 4.0 and IIS 4. When the system was rebooted I now have Event ID errors 7023 for both services. When I go into services and try to start manually I get and ERROR 0032 The Process cannot access the file because the file is being used by....

IIS Web and Ftp services won't start - The only thing I've found out that has changed on the server is that a new NIC card was put in, the IP address remained the same. Here are the errors I get in Event log, If there's somewhere else to look at for more info let me know. The IIS Admin..
   Web Hosting and Web Master Forums (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]