Jump to content

Force kill a process that hangs


JohnNash
 Share

Recommended Posts

ProcessClose works for ending a program. But now and then the program I try to close hangs (it does NOT show Not responding title,it  just hangs). In that case ProcessClose is not able to close it. But manually I could click the X. 

 

So any suggestions how to close it anyway.... (except for clicking the x).

Link to comment
Share on other sites

You could try _WinAPI_TerminateProcess? :)

Edit:

Maybe only if ProcessClose fails?

Also what was the @error value on fail?

Edited by genius257
Link to comment
Share on other sites

Thanks for the tips. Both winclose and the WINAPI terminateprocess can not do it. 

 

Indeed if I press the cross manually it will terminate. 

So weird. Should be easily fixable I would think.

I am able to get the process handle, which I thought maybe did not work, but it does...

WinKill also does not work...

Edited by JohnNash
Link to comment
Share on other sites

Well i've tried

WinKill("title of app")

Winclose ("tile of app"), also by class

_WinAPI_TerminateProcess ( $hProcess)  by handle

the code of the app that hangs I cannot provide since it is a closed source thing (not mine).

 

 

btw I just noticed the class of the process is changed into Ghost when it hangs. 

 

Link to comment
Share on other sites

  • 2 years later...
6 hours ago, barresoft said:

         $command="taskkill /im yourExecutable.exe /f"
         run($command)

or

RunWait (@comspec & " /c TaskKill /PID " & $PID & " /F")

That will work all the times.  Tested for life !

Link to comment
Share on other sites

  • Moderators

@barresoft please don't resurrect old threads, especially when the OP stated he had an accepted solution. After more than two years it is doubtful he is still looking for responses.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...