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

calling exe from a .net windows service

I've created a windows service which implements a timer. On the timer elapsed event, I'm trying to invoke another exe. The exe runs several procedures quickly (in about 10-15 seconds) and then exits on its own. The service seems to be launching that application just fine, but it doesn't seem to get through all of the procedures. If i launch that exe on its own, it works fine.

Here is the code I use to launch it:

Expand|Select|Wrap|Line Numbers
  1.     Private Sub TimerElapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
  2.  
  3.         Dim startinfo As System.Diagnostics.ProcessStartInfo
  4.         Dim pstart As New System.Diagnostics.Process
  5.  
  6.         startinfo = New System.Diagnostics.ProcessStartInfo("C:\Program Files\ActivationBatchService\ABS.exe")
  7.         pstart.StartInfo = startinfo
  8.         pstart.Start()
  9.         pstart.WaitForExit()
  10.  
  11.     End Sub
  12.  
  13.  
Any ideas?
Feb 28 '08 #1
1 1321
RedSon
5,000 Expert 4TB
I've created a windows service which implements a timer. On the timer elapsed event, I'm trying to invoke another exe. The exe runs several procedures quickly (in about 10-15 seconds) and then exits on its own. The service seems to be launching that application just fine, but it doesn't seem to get through all of the procedures. If i launch that exe on its own, it works fine.

Here is the code I use to launch it:

Expand|Select|Wrap|Line Numbers
  1.     Private Sub TimerElapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
  2.  
  3.         Dim startinfo As System.Diagnostics.ProcessStartInfo
  4.         Dim pstart As New System.Diagnostics.Process
  5.  
  6.         startinfo = New System.Diagnostics.ProcessStartInfo("C:\Program Files\ActivationBatchService\ABS.exe")
  7.         pstart.StartInfo = startinfo
  8.         pstart.Start()
  9.         pstart.WaitForExit()
  10.  
  11.     End Sub
  12.  
  13.  
Any ideas?
Instead of starting the process is there a method you can call that will let you run a dos command? You can then run your exe like you would in the command prompt.
Feb 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Michael Brandt Lassen | last post by:
Hi gurus This problem is about calling Web services secured by Forms Authentication from Windows Forms user controls embedded in HTML. Using the object tag I’ve managed to include a Windows...
3
by: belgiozen | last post by:
Hi, I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the...
1
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try...
3
by: Gary | last post by:
I am using VS.Net 2002 with windows 2000 advanced server and windows 2000 professional. I have a requirement to use windows service with a GUI. I want to show my own User Interface(Dialog) to get...
3
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
1
by: Jaime Stuardo | last post by:
i all, I have a web service in a Windows 2003 Server machine and ASP.NET 2.0. The website has windows integrated security so that, in order to allow domain users to connect to it, I add...
5
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is...
1
by: Manuel Brandao | last post by:
Hi all I would like to now the answer to the following problem, if someone can help. Given a windows application client that's calling a web service (using default credentials) the web...
7
by: GD | last post by:
Hi, I am trying to call a webservice from a windows service application. It works only if I launch the windows service app from VS.Net 2005 (Worked around from Main()) or from a winform test...
1
by: samdediacre | last post by:
Hi all, I have developped a very simple Windows service that references a managed .NET dll. the code within the dll contains a static class to read/write data from registry. So the OnStart()...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.