473,698 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems executing external application (.exe) using windows service

Jay
hi
i am jay from bangalore
i have one problem ,can u please help me out.

i have one windows application and one windows service.
from windows application i have to call one process "gpg" to encrypt
my text file so i use
system.Diagnost ics.process class to make new process.
my code is like this
Process processEncrypti on = new Process();
processEncrypti on.StartInfo.Wo rkingDirectory = @"c:\Gnu\GNUPg" ;
processEncrypti on.StartInfo.Fi leName = "gpg";
processEncrypti on.StartInfo.Ar guments = @" -o " + "\"" + path +
fileName + "\"" + " --passphrase " + passphrase + " -d " + "\"" + path
+ fileName + ".gpg" + "\"";
processEncrypti on.Start();
processEncrypti on.WaitForExit( );

this code work fine if i use this code in windows application
but it does not work at all in windows service .code runs comepletely
but does not produce any output "
it seems that this code is not able to start process "gpg" if we run in
windows service.
can u help me

thanx in advance

Jun 19 '06 #1
3 3620
Hi,

Probably permissions problems.

under what user the service is running?

Does that user has permission to read the source and write in the selected
directory?
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Jay" <ja********@gma il.com> wrote in message
news:11******** *************@p 79g2000cwp.goog legroups.com...
hi
i am jay from bangalore
i have one problem ,can u please help me out.

i have one windows application and one windows service.
from windows application i have to call one process "gpg" to encrypt
my text file so i use
system.Diagnost ics.process class to make new process.
my code is like this
Process processEncrypti on = new Process();
processEncrypti on.StartInfo.Wo rkingDirectory = @"c:\Gnu\GNUPg" ;
processEncrypti on.StartInfo.Fi leName = "gpg";
processEncrypti on.StartInfo.Ar guments = @" -o " + "\"" + path +
fileName + "\"" + " --passphrase " + passphrase + " -d " + "\"" + path
+ fileName + ".gpg" + "\"";
processEncrypti on.Start();
processEncrypti on.WaitForExit( );

this code work fine if i use this code in windows application
but it does not work at all in windows service .code runs comepletely
but does not produce any output "
it seems that this code is not able to start process "gpg" if we run in
windows service.
can u help me

thanx in advance

Jun 19 '06 #2
Jay
yes user has all the permissions to carry out execution.

Jun 20 '06 #3
Hi,
How the output is produced? does it generate a file? are you passig the
fullpath for this new file?

Are you getting any exception?

Also check the exit code of the .exe
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Jay" <ja********@gma il.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
yes user has all the permissions to carry out execution.

Jun 20 '06 #4

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

Similar topics

4
2194
by: Ricardo Correia | last post by:
Hello, Does anyone know how to open an application from a windows service?? For example, I have a windows service running and using a timer or something else I want to open Windows Calculator! I used: Shell("calc", AppWinStyle.NormalFocus) and Process.Start("calc")
1
1396
by: gaurav tyagi | last post by:
hi mahesh i am gaurav from bangalore i have one problem ,can u please help me out. i have one windows application and one windows service. from windows application i have to call one process "gpg" to encrypt my text file so i use system.Diagnostics.process class to make new process. my code is like this
1
2058
by: kimberly.walker | last post by:
I have a console application that checks the email of a user every minute. I have tried using the window service so it can run continously on the server. My question is how can I include this console application into a windows service project to make this run on the server. Can I change the console application and make it into a dll and then include it in the window service project or is there another way of doing this with out writing...
0
1272
by: anupamak | last post by:
Hello, I am developing an application in VC++.Net and windows xp using the setupapi, which has to work as windows service. Actually, in the beginning, my application was developed in VC++.Net, MFC with GUI. But now i am decoupling the GUI and want to make the application work as windows service. As a part of this, I have created my application using the windows service template. But when i embedded the files such as Dbt.h and my own...
1
1141
by: smahaboob | last post by:
Hi, Good evening to all, I want to find the windows login user name using windows service with c# . can any body help?
3
1281
by: trymore | last post by:
hi all; Can anybody help me out there, I am very niave to programming windows services. I want to convert my console application to a windows service. any information of how i start this? thanks in advance
3
1801
by: queries365 | last post by:
Hi, I have a Windows Application in place. I am new to Windows Service. So using some online tutorials, I have created a simple Windows Service. I need to launch this application whenever my service starts. Can anybody please help me in implementing the Windows Application as a Windows Service. Also let me know if any specific settings need to be done Thanking you in anticipation. Awaiting your reply
5
4091
by: codingZZ | last post by:
How do you convert a console application to a windows service.Any recommendations? The following code is below using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; using System.Management; using System.IO;
0
8676
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
8608
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
9161
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
9029
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...
0
7732
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
5860
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();...
1
3050
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
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
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.