0

I have this software PC2Control which I want to taskkill. (Also I don't want to uninstall that)

taskkill /f /t /im PCControl2Client.exe :: success

But after like 1 second, it automatically starts again. I think it could be some Windows event.

This is one way to go, but its not really good way.

while($true)
{
    $find =  tasklist | findstr "PCControl";
    if($find -eq $null)
    {
        Start-Sleep -Seconds 1;
    }
    else
    {
        taskkill /F /IM PCControl2ClientService.exe /T;
        taskkill /F /IM PCControl2ClientUser.exe /T;
        taskkill /F /IM PCControl2Client.exe /T;
    }
}

Any ideas how to stop it?

EDIT

Found it for those who are wondering.

It was service with recovery options (thanks to Toni), which you can found by typing service in search bar or powershell get-service

This will disable all recovery options using cmd.

SC failure <ServiceName> actions=""/1000/""/1000/""/1000 reset=86400
jiw
  • 43
  • 5
  • What is your question? Stop the process from restarting, or improve your `while` loop code? – Jelphy Oct 13 '22 at 15:39
  • its probably a service with configured recovery options. as you are on powershell take a look at ```get-process``` and ```stop-process```. does ```get-service | ?{$_.BinaryPathName -match 'PCControl2ClientService'}``` give you something back? – Toni Oct 13 '22 at 16:18
  • Thanks! I found it, I knew it was somewhere, but didn't know where. You helped me there with the keyword `service`, thanks! – jiw Oct 13 '22 at 19:17

0 Answers0