Command Prompt windows that close immediately after opening prevent users from running essential commands, disrupt troubleshooting, and sometimes impact other software that relies on CMD. This behavior on Windows 11 often points to a misconfigured registry, problematic startup entries, or interference from malware or third-party applications. Addressing the root cause restores normal access to CMD and improves overall system stability.
Delete the Autorun Value from the Windows Registry
Step 1: Open the Registry Editor by pressing Win + R
, typing regedit
, and pressing Enter. Approve any User Account Control prompts.

Step 2: Navigate to the following path in the Registry Editor: