473,692 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2695
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********@yah oo.com> wrote in message
news:89******** *************** *********@4ax.c om...
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_da rkfalz.com> wrote in message
news:O8******** ******@TK2MSFTN GP11.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********@yah oo.com> wrote in message
news:89******** *************** *********@4ax.c om...
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********@yah oo.com> wrote in message
news:tc******** ********@newssv r24.news.prodig y.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_da rkfalz.com> wrote in message
news:O8******** ******@TK2MSFTN GP11.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********@yah oo.com> wrote in message
news:89******** *************** *********@4ax.c om...
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********@yah oo.com> wrote in message
news:89******** *************** *********@4ax.c om...
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
2130
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. code works in .vbs but not from the webserver (IIS6). Can someone tell me how to do this? I would also like to edit the registry if i can. Thanx
3
5439
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 and show in the Component Services control panel. The issue is when we uninstall or want to upgrade the components. What we have found is if there are live instances pooled and running (which is always the case as we want them to be ready for...
2
5284
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 stop code .Abort()s the threads and .Stop()s the listener. One one of my computers, the service runs like, well...a service. It starts and stops nicely. On a different computer (eventually this service will be running on 50+ machines) the...
3
7030
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 application . But when i use the code to start /Stop the service in a aspx page i get an error like:
0
1261
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 authentication at present, so as far as I am aware I can't use windows authetication (not sure if this is relevant or not) At present the virtual directory that is running the application is set to "Anonymous" Accss and is running under the...
0
967
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 log into the server using a special login and password. Then I can open the services applet and start and stop the server. This is very inconvenient for debugging the service. What I would like to do, from my dev box, is somehow connect to...
7
7228
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 this error. I want to restart my windows service every time the COM object throws an error. I use System.ServiceProcess.ServiceController to stop and start my service. But there is one thing I do not understand:
4
21737
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 webserver to see if service A needs to be updated. What service B does if it sees their is an update for service A is to download a new copy of the service A executable, stop service A, replace the executable with the new copy, and start service B...
1
5658
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, integration services, reporting service, Agent.. -SQLS Configuration Manager -SQLS Surface Area Configuration (for Services and Connections) -Mgmt Studio Local (on server)
0
8604
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8538
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9083
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6459
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5819
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4324
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1957
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.