Problems executing external application (.exe) using Windows service

G

gaurav tyagi

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
 
B

bruce barker \(sqlwork.com\)

services can not run windows apps (say like notepad.exe), only commandline
(xcopy.exe for example).

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top