473,695 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem starting multiple external programs from windows service

1 New Member
Hi,

Our application starts an external application using System.Diagnost ics.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 application and it could start an unlimited number of sub applications, but when used as a Windows Service, for some reason we can not create more instances when the limit number is reached. They start and stop without an exception (ExitCode = 0).

We collected statistics about computer committed charge, virtual memory used, available physical memory, and other numbers collected through TaskManager. We also worked with increasing the virtual memory size on the computer, and it didn't produce any changes regardless of the virtual memory used and the computer. We tested in computers with 1.5GB physical mem and 2GB physical mem; the first with 1GB and 2GB of VM and the second with 3GB and 4GB of virtual mem.

In all cases, the service application could only start 14 processes of the targeted application; the 15th instance starts, but gets shut down. We tried this in 3 different computers.

Is there a limit on the number of applications that can be started using the system.diagnost ics.process class? Can anyone suggest a different way of doing this or some parameter that might allow us to run more external applications from the service?

Code snipet:

Process meProc = new Process();
meProc.StartInf o.FileName = "app.exe";
meProc.StartInf o.Arguments = @"/args";
meProc.EnableRa isingEvents = true;
meProc.Start();

Thanks in advance!
May 1 '07 #1
1 2221
TRScheel
638 Recognized Expert Contributor
Hi,

Our application starts an external application using System.Diagnost ics.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 application and it could start an unlimited number of sub applications, but when used as a Windows Service, for some reason we can not create more instances when the limit number is reached. They start and stop without an exception (ExitCode = 0).

We collected statistics about computer committed charge, virtual memory used, available physical memory, and other numbers collected through TaskManager. We also worked with increasing the virtual memory size on the computer, and it didn't produce any changes regardless of the virtual memory used and the computer. We tested in computers with 1.5GB physical mem and 2GB physical mem; the first with 1GB and 2GB of VM and the second with 3GB and 4GB of virtual mem.

In all cases, the service application could only start 14 processes of the targeted application; the 15th instance starts, but gets shut down. We tried this in 3 different computers.

Is there a limit on the number of applications that can be started using the system.diagnost ics.process class? Can anyone suggest a different way of doing this or some parameter that might allow us to run more external applications from the service?

Code snipet:

Process meProc = new Process();
meProc.StartInf o.FileName = "app.exe";
meProc.StartInf o.Arguments = @"/args";
meProc.EnableRa isingEvents = true;
meProc.Start();

Thanks in advance!
Try creating them in different threads
May 1 '07 #2

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

Similar topics

0
3496
by: David | last post by:
I've written a small windows service, and I'm having a problem that I'm spending a lot more time on than I'd like. If anyone has experienced this problem and has any hints or solutions; they would be appreciated. Simply leaving the threadMain() method if something unexpected occurs during thread execution leaves the thread in a ThreadState.Running state. This (apparently??) causes the Thread.Join() in service.OnStop() to hang...
4
1745
by: Mark Duregon | last post by:
Hi, I am trying to create a Windows Service in C# that will install on a single box to support multiple environments. I have created the service and it works perfect. Now however, the client has decided to run multiple environments of the application (a web app) on the one box (i.e. production, acceptance & training). The problem is that the service also needs to run in each environment with it's own configuration settings. I found an...
2
3045
by: feman | last post by:
I'm trying to install the dotnet framework 1.1 on a Windows 2000 Pro, SP 4 box. I've downloaded dotnetfx.exe and am installing from c:\temp. This is the error message that I get: Error 1606. Could not access network location %ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools. The folder exists and I've given full permission to it to everyone, so I don't think this is some kind of security issue. Here's the installation log:
1
1777
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
4
1402
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" status window, but it times out - even though the application's log file says that it did start. The service's OnStart event spawns a thread and exits - that's all! I even tried it with no code in the OnStart event and get the same thing. The service...
8
55675
by: Kevin D. | last post by:
Please note, I already posted this on the MySQL official forum, but received no response. I thought I'd try again in another location. My apologies to anyone reading this twice... Despite everything I've tried, I cannot get MySQL to start as a Windows service. However, I AM able to get it started via the mysqld-nt --console command. Here is my (funky) setup:
7
2401
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 System.Diagnostic.Process object to start the application (i.e Notepad), the new app runs and it is listed on the task manger list, but the GUI doesn't show up in the desktop of the current user. I am aware windows service (either LocalSystem,...
7
2013
by: Peter S. | last post by:
I currently have created a C# program that automatically updates an SQL database once everyday. It's an application that I manually start. I want make it so that if the (Windows 2003) server reboots the program automatically starts up. What's the best method to do this? Creating a service I guess would be one option???? BTW, I have created other programs that ran on a daily basis by having them run as a scheduled task job. However I...
7
1874
by: tim | last post by:
Hi all, I want to execute a VB application from a ASP page (not .Net). Want I want to do is that I write some parameters to a database and then start the external application that will pickup these parameters and run in the background. I looked for a sample but I can't find any. Who can help me. Many thanks Tim
0
8619
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
8971
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
8824
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
7651
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6484
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
5831
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
4336
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
4571
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1970
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.