2

Edit: People are downvoting. Can you guys explain why?

So, I'm working on something with batch files, but, sometimes, when I try to close them in the middle of their code, they'll hang.

The issue is, I can't close these hanged windows.

These are the things I've tried:

  • Task Manager > End Process (Just doesn't work)
  • Process Hacker > Terminate (Error: An attempt was made to access an exiting process)
  • Process Hacker > Terminator; all of the options besides TT4 (None of them work)
  • taskkill /f /fi "imagename eq cmd.exe"

I'm on Windows 8.1

The only way I have been able to close these processes is by logging off and back on. This means there must be a way to close them, no? So can I do that without logging off?

Quelklef
  • 600

1 Answers1

1

You can try opening Command Prompt as administrator, typing...

Taskkill /im cmd.exe /f

and pressing Enter. This will kill all batch files and Command Prompt windows.

Or find the PID of the batch file by opening Task Manager, going to the Processes tab, right clicking the name of the unresponsive window, and clicking "Go to details". Note the PID of the selected process, then open Command Prompt as admin and type...

Taskkill /pid (insert PID) /f

and press Enter. This will kill that batch file specifically but not other windows.

You
  • 86