Access running process.

F

fireloard

I have console application open running that you need to press Escape
on to get it to exit. Usually once a day/week etc I want to close that
process and start it again. Is there any way to find a process running
on a machine and send a command to it from a c# app? I don't think this
application was written in .net so it wouldn't be managed code.
 
N

Nicholas Paldino [.NET/C# MVP]

You might want to try the SendKeys class. It will allow you to send a
character sequence to the active application.

Ideally though, you would re-write this app to be a service, and then
send a pause or stop command to the service, and then just start it back up.

Hope this helps.
 
W

Willy Denoyette [MVP]

see inline

Willy.

Nicholas Paldino said:
You might want to try the SendKeys class. It will allow you to send a
character sequence to the active application.

Don't think SendKeys can be used to send key sequences to console program.

Ideally though, you would re-write this app to be a service, and then
send a pause or stop command to the service, and then just start it back
up.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I have console application open running that you need to press Escape
on to get it to exit. Usually once a day/week etc I want to close that
process and start it again. Is there any way to find a process running
on a machine and send a command to it from a c# app? I don't think this
application was written in .net so it wouldn't be managed code.
 

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

Top