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

Problems executing external application (.exe) using Windows service

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
Process processEncryption = new Process();
processEncryption.StartInfo.WorkingDirectory = @"c:\Gnu\GNUPg";
processEncryption.StartInfo.FileName = "gpg";
processEncryption.StartInfo.Arguments = @" -o " + "\"" + path +
fileName + "\"" + " --passphrase " + passphrase + " -d " + "\"" + path
+ fileName + ".gpg" + "\"";
processEncryption.Start();
processEncryption.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
bye

Jun 19 '06 #1
1 1385
services can not run windows apps (say like notepad.exe), only commandline
(xcopy.exe for example).

-- bruce (sqlwork.com)


"gaurav tyagi" <gt*****@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
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
Process processEncryption = new Process();
processEncryption.StartInfo.WorkingDirectory = @"c:\Gnu\GNUPg";
processEncryption.StartInfo.FileName = "gpg";
processEncryption.StartInfo.Arguments = @" -o " + "\"" + path +
fileName + "\"" + " --passphrase " + passphrase + " -d " + "\"" + path
+ fileName + ".gpg" + "\"";
processEncryption.Start();
processEncryption.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
bye

Jun 19 '06 #2

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

Similar topics

4
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!...
3
by: Jay | last post by:
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...
1
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...
0
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,...
1
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
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? ...
3
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...
5
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...

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.