473,795 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

starting a process from a windows service

Hello,
I have successfully created a windows service. I would now like
the windows service to call another program and start it when the
service starts. I have been unable to do this. For the windows
service OnStart sub I have the following code:

Protected Overrides Sub OnStart(ByVal args() As String)
EventLog1.Write Entry("In OnStart")

Process.Start(" Explorer.exe")

End Sub

However this code does not start the windows explorer. Does anyone
know what I am doing wrong?

Thanks,
Billy
Nov 20 '05 #1
2 1332
Cor
Hi Billy,

Where you want the Explorer to start, on your server where your service is
running?

I think this would be a security problem if you could do this on your
client.

But just my thought,

Cor
Hello,
I have successfully created a windows service. I would now like
the windows service to call another program and start it when the
service starts. I have been unable to do this. For the windows
service OnStart sub I have the following code:

Protected Overrides Sub OnStart(ByVal args() As String)
EventLog1.Write Entry("In OnStart")

Process.Start(" Explorer.exe")

End Sub

Nov 20 '05 #2
Cor,
I am just using explorer as an example program to start. In
reality I am trying to start a program that I wrote that automatically
parses XML documents. I have been trying to figure out this problem
for several days now... with no luck. I may have to refrase my
problem and repost.

Billy

"Cor" <no*@non.com> wrote in message news:<uN******* ******@TK2MSFTN GP11.phx.gbl>.. .
Hi Billy,

Where you want the Explorer to start, on your server where your service is
running?

I think this would be a security problem if you could do this on your
client.

But just my thought,

Cor
Hello,
I have successfully created a windows service. I would now like
the windows service to call another program and start it when the
service starts. I have been unable to do this. For the windows
service OnStart sub I have the following code:

Protected Overrides Sub OnStart(ByVal args() As String)
EventLog1.Write Entry("In OnStart")

Process.Start(" Explorer.exe")

End Sub

Nov 20 '05 #3

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

Similar topics

1
1786
by: Glenn | last post by:
I have used this code successfully in a form application. I tried to add the same code in a service and have not been able to get the application to start. I have the service starting with a local account and the Interact with the Desktop is Checked. Windows media player seems to start but then closes almost immediately. I would appreciate any help. Thanks, Glenn
3
3058
by: Timothy Shih | last post by:
Hi, I am trying to start a process from inside a .NET service. The process is a simple GUI app, the service will start up the GUI and then stop itself. The service starts the app, but no GUI appears. However, I can see the application running in the task manager. I made sure that CreateNoWindow was set to false and still no GUI appears. If i run the application by double clicking on it, the GUI appears fine. Here is the code: Process...
2
2231
by: Razzie | last post by:
Hey all, I wrote a Windows Service. When I test it on my developement machine (winXP) it works fine. It starts ok, never crashes, etc. When I install the service on another machine (win2000) it *sometimes* crashes upon starting. The progressbar you get when you manually start the server will very slowly progress, and when it hits 100% after 2 minutes or something I get the error 'The service could not be started because it did not...
4
2425
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). The problem is that the user who "owns" the service is always the ASPNET account. That's not good since you don't see the actual application (because it's owned by ASPNET). I've tried changed the processmodel section in the machine.config file to...
3
2574
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows service. The service is running with the credentials of a specified domain user, and all processes kicked off by the scheduler service runs with these credentials. In the web based interface I want to add a "Run" button for each job, making it...
0
2814
by: tshad | last post by:
I have a Windows Service I created that just sets a timer and writes to EventLog every 10 seconds. It installed fine and it actually starts. But it says it doesn't. The progress bar shows the progress fine until it hits about halfway. It then stops there for about 4 or 5 seconds then goes a little farther. I then get a message: Could not start the MyService Service on Local Computer. Error 1053: The service did not respond to the...
6
4206
by: Arnie | last post by:
We're using the ServiceController class provided by the .NET Framework, programming in C#. We are using the Start() method to start a service from another service. This works fine most of the time, but occasionally after a system startup (where the service doing the starting of the other is automatically started by Windows XP) the ServiceController's Start() method fails to start the other service. It is probably throwing an...
5
4491
by: Benzi Eilon | last post by:
I have written a C# application which should run as a Windows Service. I must avoid having multiple instances of the application on one machine so I inserted the following code at the beginning of the Main() function: // if this is not the first instance of this application, exit // immediately. Allow only one instance in the system if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
1
2232
by: mikelujan | last post by:
Hi, Our application starts an external application using System.Diagnostics.Process class and the Start() method, as per code snippet below. This application run as a Windows service, and must start several instances of the same application, like multiple Windows Calculators for instance. We are experiencing difficulties starting applications after a certain number have been started. We changed our app to work as a Console...
0
1690
by: dom_perron | last post by:
Hi, I have a problem when I try to start an application using MSMQ from a Windows Service. The application runs on a server. The client send a message to a public queue created on the server, the server process the request and return the result to a public queue on the client. All is working fine if I start my application directly on the server. But we want to embed the start of the application into a Windows service. When I install...
0
9672
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
10436
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...
0
10213
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6780
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
5436
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...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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.