473,387 Members | 1,495 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,387 software developers and data experts.

Starting a window service from a web page

Hello, I am tring to create a windows service monitor use asp.net and
vb.net. I cannot seem to be able to start a windows service from a
webpage because I do not have access to the "System.ServiceProcess"
namespace. I also tried to start it as I would a normal program using
the "System.Diagnostics.Process.Start" namespace, but I get an error
message saying that "Cannot start service from the command line or
debugger. A Windows service must first be installed and then started
with the ServerExplorer, Windows Service Administive Tools, or the NET
START command."
I know I could use the webpage to send data to a "master" windows
service and have that open up programs, but I don't want to rely on it
in case it is down. I also don't want to use a windows application
because I want to be able to start and stop services without logging
on to the computer. Is there any way of doing this? Or would I have to
default to doing one of these other solutions?

thanks.

Aug 8 '07 #1
1 1047
Jo*****@gmail.com wrote:
Hello, I am tring to create a windows service monitor use asp.net and
vb.net.
You're going to hit lots of permissions problems here.
I cannot seem to be able to start a windows service from a
webpage because I do not have access to the "System.ServiceProcess"
namespace.
Did you add a Reference to the required Assembly? You /won't/ have one
by default in a web application which, I'm guessing, is why you can't
access it. Remember; Imports /doesn't/ get you access to anything you
didn't have before - it only allows you to /type/ less code.
I also tried to start it as I would a normal program using
the "System.Diagnostics.Process.Start" namespace, ....
Quite right. You can't just "run" a Service, it has to be installed and
started via the Service Control Manager.
Is there any way of doing this?
I /think/ you might be able to use the Windows Scripting Host to do this
but the ServiceProcess namespace is the better way.

HTH,
Phill W.
Aug 9 '07 #2

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

Similar topics

0
by: pillbug22 | last post by:
Hi everyone I am trying to write a fairly simple VB.NET service (use a timer to poll a network location for a file, if file exists, send message) The service correctly start, stops, runs the...
3
by: Lou | last post by:
I've been struggling trying to start DB2 8.1 on my Windows XP workstation. Supposedly I have to enable JDBC before starting DB2 running usejdbc2.bat script, but I can't find it anywhere on C:...
5
by: Steve Long | last post by:
Hello, I hope this question isn't too fundamental. I have a feeling it is. I'm trying to start a winform app from a windows service written in C#. I created a class and used it from a windowsforms...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
4
by: hogcods | last post by:
I'm having a strange problem with a service I developed. After installing the service on the target machine, I'm trying to start it using the Services admin window. I get the "Windows is starting"...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
7
by: Ahmed Perlom | last post by:
Hi all, I am trying to start a windows application that has a GUI from a Windows service written in .NET 2.0. I have been searching on this for few days now with no avail. When using the...
0
by: Mark Henry | last post by:
I wrote a Desktop class for manipulating desktops and window stations. The class is being used by a service for starting applications on the interactive desktop (the service cannot run as Local...
4
by: rottmanj | last post by:
I have written an application that installs a service and then is supposed to start the service. Everything works great except for the service starting(either with AfterIntall or starting it from the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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,...

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.