473,659 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Execute an external program from a Windows Service

Hello,

I have a piece of code that runs Ok in a normal Windows application,
but not when run as a windows service. The code tries to run an
external program (ARJ32.EXE). The code is :

myProcess.Start Info.FileName = strRutaARJEXE
myProcess.Start Info.Arguments = " e -u -y " & strRutaFitxerAR J
& " " & strRutaDescompr imir
myProcess.Start Info.UseShellEx ecute = False
myProcess.Start Info.ErrorDialo g = True

myProcess.Start Info.WindowStyl e = ProcessWindowSt yle.Normal
myProcess.Start Info.CreateNoWi ndow = False
Try
myProcess.Start ()
Catch e As Exception
Debug.WriteLine (e.Message & " " & e.Source)
End Try

No exception is caught and no process runs !!

Thanks,

Xavier
Nov 19 '05 #1
1 4327
Your services needs to be allowed to interact with the User's desktop. Check
it's property in the SCM.

--
Happy to help,
-- Tom Spink
(th**********@n tlworld.com)

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit
"Xavitin" <xb***@geshos.c om> wrote in message
news:5b******** *************** ***@posting.goo gle.com...
Hello,

I have a piece of code that runs Ok in a normal Windows application,
but not when run as a windows service. The code tries to run an
external program (ARJ32.EXE). The code is :

myProcess.Start Info.FileName = strRutaARJEXE
myProcess.Start Info.Arguments = " e -u -y " & strRutaFitxerAR J
& " " & strRutaDescompr imir
myProcess.Start Info.UseShellEx ecute = False
myProcess.Start Info.ErrorDialo g = True

myProcess.Start Info.WindowStyl e = ProcessWindowSt yle.Normal
myProcess.Start Info.CreateNoWi ndow = False
Try
myProcess.Start ()
Catch e As Exception
Debug.WriteLine (e.Message & " " & e.Source)
End Try

No exception is caught and no process runs !!

Thanks,

Xavier

Nov 19 '05 #2

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

Similar topics

2
3574
by: Juan Manuel Alegría B. | last post by:
Hi group I have been making a windows service to execute an external application. I use a timer control, I can execute the application but does't appear as a normal windows, just I see it in the windows task manager as a local service. I think it must appear as a normal process. Someone knows about it or has any idea? Juan Manuel Alegria B. Jalisco, México.
4
5455
by: Tom | last post by:
Hi, I wrote a java console program. But, I am not familiar with Swing to write the GUI. I want to use C# to write the GUI, e.g. a start and a stop buttons. When I click the start button, it execute the jar file. Or, I wrote a batch file and let the GUI to run it.
4
7868
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed. Instead of getting my Web page, or the Web Service page, I get a page full of error text...
3
5761
by: eieiohh | last post by:
MySQL 3.23.49 PHP 4.3.8 Apache 2.0.51 Hi All! Newbie.. I had a CRM Open Source application installed and running. Windows Xp crashed. I was able to copy the contents of the entire hard drive onto a USB External Hard Drive. I have to assume I also copied the data. I
0
1345
by: lcifers | last post by:
I have written an application and tested it as a Windows executable. It works fine. The application uses an external COM application to process some existing files. But I can't seem to start that external program correctly. I've found this code: ' Set process parameters Dim myProcess As New System.Diagnostics.Process myProcess.StartInfo.FileName = "notepad.exe" ' Allow the process to raise events
4
8478
by: =?Utf-8?B?TEJU?= | last post by:
Good day, I would like to execute an external application from a web form created using ASP.Net. I'm using System.Diagnostics.Process. It works fine if it is notepad.exe but it is not able to execute even a simple VB.Net windows application. No error is being returned. The application just can't be opened (even it is not found inside Task Manager of my web server). Any idea? I'm using IE v 6.0.2900.2180.xpsp_sp2_gdr.050301-1519. My code...
1
3579
by: sandy | last post by:
Hi, I am trying to invoke an external email management program from my ASP.NET web application. For testing purposes I created a very simple webform that has a single button. The code behind has the following: Sub btnGo_Click(ByVal sender as System.Object, ByVal e as System.EventArgs) Handles btnGo.Click
1
2219
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...
5
7055
by: sayeo87 | last post by:
Hi, I am quite new to JSP so please forgive me if I ask really simple things... I am trying to run system commands on the server and display the output on a webpage. This is what I've got: <%@ page import="java.io.*" %> <HTML> <BODY> <% Runtime rt = Runtime.getRuntime(); Process p = rt.exec("/bin/ls");
0
8428
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
8339
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
8751
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
8535
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
7360
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...
0
5650
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
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2757
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
1739
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.