473,394 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

start/stop services programatically

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
Nov 18 '05 #1
4 2682
call the command line
"net stop <service>" and
"net start <service>"

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
<vi********@yahoo.com> wrote in message
news:89********************************@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

Nov 18 '05 #2
Vic
this leads me to a couple of other questions. How can I do this within a C#
method? Also, is there a way to collect the names of the <service>'s that I
need to stop, especially those using the MetaBase.xml file.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
call the command line
"net stop <service>" and
"net start <service>"

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
<vi********@yahoo.com> wrote in message
news:89********************************@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


Nov 18 '05 #3
bunch of ways to call the command. Look/search for calling an EXE, same
principle.
Now, to get a list of running services, Don't know off the top of my head
but if you google it you should get something. Try www.4guysfromrolla.com
I'd bet they got something, otherwise www.asp.net should.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Vic" <vi********@yahoo.com> wrote in message
news:tc****************@newssvr24.news.prodigy.com ...
this leads me to a couple of other questions. How can I do this within a C# method? Also, is there a way to collect the names of the <service>'s that I need to stop, especially those using the MetaBase.xml file.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
call the command line
"net stop <service>" and
"net start <service>"

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
<vi********@yahoo.com> wrote in message
news:89********************************@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



Nov 18 '05 #4
Simply drag a Windows Service from your server explorer window onto a
webform. This will create a nice simple control on your form and you can
call the start and stop methods on it. You can use the same component
programatically from other classes too. Tip: You may need to use
impersonation to have the necessary permissions to start & stop windows
services.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
<vi********@yahoo.com> wrote in message
news:89********************************@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

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nathan Henderson | last post by:
I am trying to stop and start the ftp service from an asp page using the iuser account. my code is simple: shell.run "net start msftpsvc",0,true. ASP page returns no errors but nothing happens....
3
by: Robert | last post by:
We have several serviced components written in .NET 1.1. Using Visual Studio, we have an installer project that creates an installer for them. The components are installed properly into the GAC...
2
by: 0to60 | last post by:
I have a windows service that when started creates two threads: one thread that runs a TcpListener waiting for TcpClients to connect, and another thread that reads from the resulting sockets. My...
3
by: SenthilVel | last post by:
Hi All i do need to control my windows services using aspx pages. I used the System.ServiceProcess.ServiceController namespace .... this is working fine when i run my code in a windows...
0
by: martin | last post by:
Hi, I have a website on my local development machine that has a page where a small number of services (that I have wrote myself) can be either started or stopped. The website uses forms...
0
by: Chris Dunaway | last post by:
I wish to write a small application that will allow me to start and stop a windows service on another server. Currently, I have to connect to the server using Remote Desktop Connection and then...
7
by: shai | last post by:
I am working at .net 1.1, writing in c#. I have windows service with a COM object. Every unexpected time The COM object throw an error that make my service get stuck (do not respond). I can catch...
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
1
by: aj | last post by:
A few service stop/start/restart questions on SQL Server 2005 SP2, which I'll call SQLS. It looks as if there are *potentially* 6 ways to start/stop SQLS Services like the engine itself,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.