0X0000023C: App Terminated by Ctrl+C – Quick Fix
This error means your app closed because of a Ctrl+C command. It's usually a user mistake or a script bug. Here's how to stop it.
You hit Ctrl+C and your app died. Here's how to fix it.
I hear you. You're working, something crashes, and you see that weird 0X0000023C code. It says ERROR_CONTROL_C_EXIT. Don't panic. This isn't a virus or a hardware failure. You or something else sent a Ctrl+C signal to your program, and it shut down. Simple.
Let me show you how to stop it from happening again – and how to fix it if it's a script or batch file causing the trouble.
The quick fix – check your keyboard first
Most of the time, this error happens because you accidentally pressed Ctrl+C. If you're running a command in Command Prompt or PowerShell and you hit Ctrl+C, the program stops. That's normal.
Here's what to do:
- Don't press Ctrl+C unless you want to stop the program.
- If you're running a batch file or script and it stops with this error, look at the code. Some scripts use Ctrl+C to exit. For example, a batch file that runs
choice /c:ynand you press C can trigger this. - If you're in a command prompt window, just close the window normally (type
exit) instead of hitting Ctrl+C.
Had a client last month whose entire inventory system kept crashing. Turns out his cat walked on the keyboard and hit Ctrl+C. Told him to close the command window when not in use. Problem solved.
If it's a script or batch file causing the issue
Sometimes you write a batch file or PowerShell script that calls another program, and that program exits with this error. Here's the real fix – skip the fancy stuff.
In a batch file, if you're running a command that might receive a Ctrl+C signal, you can suppress it with @echo off and setlocal. But that won't stop the signal. What you need is to disable Ctrl+C handling temporarily. Use this:
@echo off
setlocal enabledelayedexpansion
REM Disable Ctrl+C for this batch file
title MyBatch
REM Your commands here
cmd /c "exit /b 0"For PowerShell, use $Host.UI.RawUI.FlushInputBuffer() to clear any pending Ctrl+C signal before running your main command. Or just run your script with -NoProfile and -ExecutionPolicy Bypass to avoid weird profile scripts that send Ctrl+C.
But honestly, most of the time it's user error. I've seen countless cases where IT guys swore their code was clean, but the moment they stopped hitting Ctrl+C out of habit, the error vanished.
Why does this happen anyway?
Windows sends a CTRL_C_EVENT to your console application when you press Ctrl+C. The app then handles it – either it stops gracefully or it crashes with this error. If the app doesn't handle it properly (like a poorly written batch file), you get 0X0000023C.
It's not a bug in Windows. It's a feature. Ctrl+C was designed in the 1970s to stop runaway programs. Your app just didn't know how to handle it nicely.
Less common variations of this issue
Sometimes the error appears even when you didn't press Ctrl+C. Here's what I've seen:
- Remote Desktop sessions: If you're logged into a remote machine and someone hits Ctrl+C in their local command line, it can send the signal through the RDP session. Fix: use
mstsc /adminto isolate sessions. - Task Scheduler: A scheduled task running a batch file might get this error if Windows sends a termination signal during shutdown. Fix: add
timeout /t 5 >nulat the end of your script to wait before exiting. - Malware or antivirus: Some aggressive antivirus programs simulate Ctrl+C to stop suspicious scripts. Check your antivirus logs. Had a client whose Norton was killing his backup script daily. Had to add an exception.
- Hotkey conflicts: Third-party tools like AutoHotkey or gaming software can remap keys and send Ctrl+C unintentionally. Disable them one by one to find the culprit.
How to prevent this from coming back
Prevention is easy but people skip it:
- Stop pressing Ctrl+C when you don't mean to. Seriously. That's #1.
- If you're writing scripts, add a
trap { exit 0 }in PowerShell to catch the Ctrl+C signal gracefully. In batch, usesetlocalandcmd /cas shown above. - Run your scripts from a dedicated command window – not one you use for other commands. That way you won't accidentally hit the hotkeys.
- For critical tasks, use
start /waitorcallin batch files to prevent the parent script from dying when the child exits.
And if you're still stuck, just reboot. Nine times out of ten, a reboot clears whatever ghost is sending that Ctrl+C signal. I know that sounds lazy, but it works.
You break it, you fix it. This error is you (or your script) breaking it. Take responsibility, and it won't happen again.
That's it. No magic. Just a keyboard shortcut that got out of hand.
Was this solution helpful?