0

I have a console application running remotely in multiple computers.

I was wondering if there's any way to quit from it remotely and then start it again.

I saw the use of taskkill to quit the application, but... is that the correct way of doing it? Won't it have consequence in terms of memory usage as the application process is being forced to quit rather than terminate in a normal way?

Then, would it be possible to start the application remotely taking into account that its a console application which requires an input line of text to start?

For example:

> C:/myApp/start.exe
> Aplication running... add a command:
> ...

Steve
  • 203
  • 6
  • 13

2 Answers2

1

Did you try using PSTools for this purpose. If the console application runs using any process then the PSTools can help you. PSkill.exe and Psexec.exe can be used to kill a process (application) and start a process remotely. But you should aware of the remote machine username and password in order to authenticate the PSTools. If it is domain environment, then it is a easy way to perform this remote activitites.

http://technet.microsoft.com/en-in/sysinternals/bb896649.aspx

Hope this helps.

vembutech
  • 390
  • 1
  • 8
  • Yeah, that's what I ended up using.The only problem I'm facing is that I can start the .exe console application but then I can not add a line into its command line. – Steve Sep 23 '14 at 09:33
  • I updated my question. – Steve Sep 23 '14 at 09:34
  • I opened another question: http://serverfault.com/questions/630523/add-a-command-into-an-existent-remote-console-application – Steve Sep 23 '14 at 09:43
0

It will clear the application from memory, what is the time frame for stopping and starting it again? Reason why I ask is you could use taskkill /s <hostname> /PID <PID> or /im <imagename.exe> to do this remotely but then you’d need to execute another command to restart the process, that’s easily done with psexec,winrs or with a scheduled task.

You could also do this as a batch file, start with taskkill or psexec then continue down on another line to start the process again.

Some of these are limited to authentication obviously.

Ben Lavender
  • 274
  • 1
  • 5