Some end users are experiencing issues with the Command Prompt when it disappears after launching. There are different reasons why this problem can occur including corrupt or modified registry keys or malware infection. This issue can occur on any Windows client operating system as well. All the solutions that we will cover in this article can be applied to all versions of Windows
Do note that you can always use the alternative solution of PowerShell, but the focus of this article is to find the cause of the problem and fix it accordingly.
Solution 1: Remove AutoRun Key in Registry
The Registry database consists of thousands or even millions of registry keys that store information about the configuration settings in Windows. Whenever you make changes to the system, they will be tracked and stored in the Registry database.
Unfortunately, sometimes some of the registry keys can get corrupt or modified by drivers, software, updates, or malware infections. The same issue can cause CMD not to work properly. In this solution, we will remove the Auto-run key and see if this fixes the problem.
- Right-click on the Start menu and then click Run. Type Regedit in the dialogue box and then press Enter
- Expand to the following key
HKEY_CURRENT_USER > Software > Microsoft > Command Processor > AutoRun
- Right-click on AutoRun and then click Delete. After deleting close the Registry Editor and restart your computer.
- Now launch the command prompt again and see if this fixes your problem.
Step 2: Check against malware on your System
One of the reasons why this problem could occur is that your system files are infected by malware. We strongly recommend running the antivirus scan and verify if you have any malware on your system. We removing malware using Malwarebytes and restarting your system before checking the command prompt again.
Solution 3: Running System Restore
If the first two solutions do not work for you, we recommend using System Restore to restore to a previous snapshot of your System. System Restore is a tool integrated into Windows that can create checkpoints whenever you perform system change, install or update drivers.
In case your Windows does not behave properly after the change, you will be able to restore it to the state when everything worked properly. The nice thing about checkpoints is that they can be created manually and automatically, both. To restore Windows to the previous state, System Restore must be enabled.