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
  • 590
  • 10
  • 18
  • Use Kernel Detective provided by AT4RE – Abr001am Jun 22 '15 at 19:08
  • "Unsupported operating system" – Quelklef Jun 22 '15 at 19:49
  • It seems like the problem might be related to the kinds of things the batch file is doing at the time. Can you elaborate? – fixer1234 Jun 23 '15 at 03:54
  • A few times, they were in a very quickly looping loop -- no delay. I have that no more, so that's no issue. The one other time was when it was compiling via `java -jar ___.jar` in Git. It hung since I tried to exit when it was loading resources, I think. – Quelklef Jun 23 '15 at 04:09
  • @PieCrust try compatibility -> run as windows XP – Abr001am Jun 23 '15 at 21:12
  • 1
    Don't know who is downvoting but this is a valid question. I have the same issue with Windows 10. Additional information: `taskkill` "`Reason: There is no running instance of the task."` – FractalSpace Nov 11 '16 at 16:35
  • Maybe it's an unkillable process. Please see ["How can I kill an unkillable process?"](https://superuser.com/questions/136272/how-can-i-kill-an-unkillable-process) and [my comment on that question](https://superuser.com/questions/136272/how-can-i-kill-an-unkillable-process#comment1727588_136272). – unforgettableidSupportsMonica Mar 20 '17 at 12:17
  • The error message you saw, "An attempt was made to access an exiting process", is the MessageText for the MessageId `STATUS_PROCESS_IS_TERMINATING`, which is NTSTATUS 0xC000010A. All this is according to the "ntstatus.h" header file, which is included in the Windows SDK. – unforgettableidSupportsMonica Mar 20 '17 at 12:38

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
  • 3