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

process.start is not working in Windows Service

I am running process.sart to run gpg.exe to encrypt files. It's working fine
with console application. When i use same code in windows service. It's not
working. It's not even throwing error.Follwoing is the code i am using.
Please somebody help me.

Process p = new Process();
p.StartInfo.WorkingDirectory = Path;
p.StartInfo.FileName = fileName;
p.StartInfo.Arguments =arguments;
p.Start();
p.WaitForExit();

Thank You
Reddy

Oct 11 '06 #1
5 6633
Hello Reddy,

I think that it's not very good idea to start process from service.
Service works in different context then your app, and can be start before
any user log on.

Try to divide starting app from service, service can inform other user's
app to start you process

RI am running process.sart to run gpg.exe to encrypt files. It's
Rworking fine with console application. When i use same code in
Rwindows service. It's not working. It's not even throwing
Rerror.Follwoing is the code i am using. Please somebody help me.
R>
RProcess p = new Process();
Rp.StartInfo.WorkingDirectory = Path;
Rp.StartInfo.FileName = fileName;
Rp.StartInfo.Arguments =arguments;
Rp.Start();
Rp.WaitForExit();
RThank You
RReddy
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Oct 11 '06 #2
Thanks Michale, I didn't quite get what you said. "Try to divide starting app
from service, service can inform other user's app to start you process"

Could you please give some example?

Thanks
reddy
"Michael Nemtsev" wrote:
Hello Reddy,

I think that it's not very good idea to start process from service.
Service works in different context then your app, and can be start before
any user log on.

Try to divide starting app from service, service can inform other user's
app to start you process

RI am running process.sart to run gpg.exe to encrypt files. It's
Rworking fine with console application. When i use same code in
Rwindows service. It's not working. It's not even throwing
Rerror.Follwoing is the code i am using. Please somebody help me.
R>
RProcess p = new Process();
Rp.StartInfo.WorkingDirectory = Path;
Rp.StartInfo.FileName = fileName;
Rp.StartInfo.Arguments =arguments;
Rp.Start();
Rp.WaitForExit();
RThank You
RReddy
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Oct 11 '06 #3
Hello Reddy,

Create small user app that is started when user log on and that will be responsible
for starting new process. Name it like ProcessFactory.
When your service need to start new process just inform it about your ProcessFactory
(via IPC) and your ProcessFactroy will start required process

RThanks Michale, I didn't quite get what you said. "Try to divide
Rstarting app from service, service can inform other user's app to
Rstart you process"
R>
RCould you please give some example?
R>
RThanks
Rreddy
R"Michael Nemtsev" wrote:
>Hello Reddy,

I think that it's not very good idea to start process from service.
Service works in different context then your app, and can be start
before any user log on.

Try to divide starting app from service, service can inform other
user's app to start you process

RI am running process.sart to run gpg.exe to encrypt files. It's
Rworking fine with console application. When i use same code in
Rwindows service. It's not working. It's not even throwing
Rerror.Follwoing is the code i am using. Please somebody help me.
R>
RProcess p = new Process();
Rp.StartInfo.WorkingDirectory = Path;
Rp.StartInfo.FileName = fileName;
Rp.StartInfo.Arguments =arguments;
Rp.Start();
Rp.WaitForExit();
RThank You
RReddy
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Oct 11 '06 #4
Michael,
I never used IPC. Is it available in 1.1? If so Could you please tell me
how to use IPC.

Thank you very much for your responses.

"Michael Nemtsev" wrote:
Hello Reddy,

Create small user app that is started when user log on and that will be responsible
for starting new process. Name it like ProcessFactory.
When your service need to start new process just inform it about your ProcessFactory
(via IPC) and your ProcessFactroy will start required process

RThanks Michale, I didn't quite get what you said. "Try to divide
Rstarting app from service, service can inform other user's app to
Rstart you process"
R>
RCould you please give some example?
R>
RThanks
Rreddy
R"Michael Nemtsev" wrote:
Hello Reddy,

I think that it's not very good idea to start process from service.
Service works in different context then your app, and can be start
before any user log on.

Try to divide starting app from service, service can inform other
user's app to start you process

RI am running process.sart to run gpg.exe to encrypt files. It's
Rworking fine with console application. When i use same code in
Rwindows service. It's not working. It's not even throwing
Rerror.Follwoing is the code i am using. Please somebody help me.
R>
RProcess p = new Process();
Rp.StartInfo.WorkingDirectory = Path;
Rp.StartInfo.FileName = fileName;
Rp.StartInfo.Arguments =arguments;
Rp.Start();
Rp.WaitForExit();
RThank You
RReddy
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Oct 11 '06 #5
Hello Reddy,

IPC is a general name for such things like Sockets, Pipes, Mailslot, remoting,
dcom, filemapping and etc - everything that imply interaction between processes.

You need to select which way of IPC suites u the best.

I recomend to look there for the samples of IPC http://www.codeproject.com/info/sear...ed=11+Oct+2006

In your case, where only message notification is required, I'd select the
remoting with events
RMichael,
RI never used IPC. Is it available in 1.1? If so Could you please
Rtell me
Rhow to use IPC.
RThank you very much for your responses.
R>
R"Michael Nemtsev" wrote:
R>
>Hello Reddy,

Create small user app that is started when user log on and that will
be responsible
for starting new process. Name it like ProcessFactory.
When your service need to start new process just inform it about your
ProcessFactory
(via IPC) and your ProcessFactroy will start required process
RThanks Michale, I didn't quite get what you said. "Try to divide
Rstarting app from service, service can inform other user's app to
Rstart you process"
R>
RCould you please give some example?
R>
RThanks
Rreddy
R"Michael Nemtsev" wrote:
>>>Hello Reddy,

I think that it's not very good idea to start process from service.
Service works in different context then your app, and can be start
before any user log on.

Try to divide starting app from service, service can inform other
user's app to start you process

RI am running process.sart to run gpg.exe to encrypt files. It's
Rworking fine with console application. When i use same code in
Rwindows service. It's not working. It's not even throwing
Rerror.Follwoing is the code i am using. Please somebody help me.
R>
RProcess p = new Process();
Rp.StartInfo.WorkingDirectory = Path;
Rp.StartInfo.FileName = fileName;
Rp.StartInfo.Arguments =arguments;
Rp.Start();
Rp.WaitForExit();
RThank You
RReddy
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its
opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Oct 12 '06 #6

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

Similar topics

3
by: belgiozen | last post by:
Hi, I have a working windows service,it is looking for files on the disk and when some of the files are cupdated it calls an executable. But it takes a lot of time(about 10 minutes) to run the...
3
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows...
5
by: Paul Bergson | last post by:
I have been trying to get a process to start up and run with arguments passed to it. I have gotten close (Thanks to help from this board) but I there is a failure while I'm running this because...
6
by: kk | last post by:
hello to all, I want to call an exe file on other system(on the same LAN)though a webservice(by placing the dll).For that i use the following code in C#...... Process ps = new Process();...
3
by: Vicky_r | last post by:
hi.. I am using Process class to run a .bat file. The .bat file contains the code to run the Session StateServer. First I have written a command in a text file then I convert it to bat and...
5
by: Rob R. Ainscough | last post by:
I'm using the Diagnostics.Process approach to shelling out run the following: C:\Windows\System32\MSIEXEC.EXE /x {73F1BDB7-11E1-11D5-9DC6-00C04F2FC33B} /q ..FileName =...
5
by: Benzi Eilon | last post by:
I have written a C# application which should run as a Windows Service. I must avoid having multiple instances of the application on one machine so I inserted the following code at the beginning of...
3
by: Billy Bob | last post by:
Hello In C# how can i start a remote process such as someapp.exe on a remote PC? I know the remote PC's name, but how do I start the app on that PC? Thanks ..
4
by: Steven De Smet | last post by:
Hello, This is my first post. I searched on the internet for answers but I was unable to solve my problem. So I hope that you guy's can help me with my VB.NET problem I tried to create a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.