How to abort a batch file, command, or program stuck in a loop

Updated: 02/01/2021 by Computer Hope
aborting batch file

While working on your computer, you may encounter a situation where a program, batch file, script, or command executed on the computer becomes stuck in a loop. Listed below are different methods for aborting these loops.

Ctrl+C

One of the most universal methods of aborting a batch file, command, or another program while it's running is to press and hold Ctrl+C. This keyboard shortcut sends a SIGINT (signal interrupt or Signals Intelligence) signal, which cancels or terminates the currently-running program and returns you to the command line.

Ctrl+Pause/Break

Like Ctrl+C, pressing Ctrl+Break key aborts almost all batch files, commands, scripts, or other programs.

Close window

If, after trying the above suggestions, you're still unable to abort the program and it's running in a window, click the X to close the window.

Ctrl+Alt+Del

Finally, if you're still unable to abort the batch file, command, script, or another program, press Ctrl+Alt+Del keys at the same time to open the Task Manager. Highlight the program you want to end and click the End Process or End Task button.

Tip

See our End Task page for further information about help with this process.