paexec leave Services behind after running...

Viewed 0

V1.2.1

Using paexec from program to run remote commands. Seems to work, however it leaves Windows Services behind it after execution. Going to the Control Panel/Services after running for a little while, I see that on each target, I have a large number of services named PAExec-<pid>-<client> left behind.

Is this a known issue? Is this new? How can I get rid of this behaviour?

Thanks,

Dominique

3 Answers

Further trials/exploration seem to show that this happens when process gets killed.. [I did process.WaitForExit(someTimeout); if (! process.HasExited()) process.Kill(); ] This leaves a service definition behind...

Hi --

PAExec will clean up it's service definition when it shuts down, but if it's killed, it doesn't get a chance to do the cleanup. I don't know how it could if the cleanup code can't run :(

Any resolution for this?

Are you using v1.22 or newer? v1.22 made additional attempts to clean up the service.

This is actually kind of funny but we have a program that copies itself in a remarkably similar method to yours. I actually spent a good portion of December rewriting the code to resolve this issue. Now we're not even handling the stop event or spawning a process. Now we just register the ctl handler, set running, run the program(less than 10 seconds) and tell the service manager that we stopped and then bail. In fact I was noticing with the remote debugger that if you're deleting yourself, sometimes that doesn't complete before the process bails. Now we're deleting from outside

and checking to make sure that process is deleted, but we're getting many failures. We're at our wits end with this issue so I finally typed into The Googles, "psexec source code" and that brought me here. Until now I had no idea that someone else had tackled this issue.

Related