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

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.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

Jun 19 '06 #1
3 3610
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********@gmail.com> wrote in message
news:11*********************@p79g2000cwp.googlegro ups.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.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

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********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.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
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!...
1
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...
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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.