- #Command prompt opening and closing windows 10 windows 10#
- #Command prompt opening and closing windows 10 software#
Next, click the Quick Scan button to perform a scan. If you want to, open the Windows Security page in the Settings app, and then click Virus & Threat Protection. You can also use the built-in Windows Defender in Windows 11 to scan your computer for malware. In case you are proceeding to purchase antivirus software, here are the 17 aspects you should always consider.
#Command prompt opening and closing windows 10 software#
Here is a list of the top antivirus software to use to perform the scan. Therefore, it is recommended that you perform a deep system scan and get rid of any trojan horses or malware. Scan computer for malwareĪnother likely cause for the Command Prompt to behave abnormally is due to malware or viruses in your computer. The Command Prompt will no longer automatically open or close if it is caused by Microsoft Office’s scheduled task. Once done, restart your computer so the changes can take effect.Now right-click the task OfficeBackgroundTaskHandlerRegistration in the right-hand pane, and then click End from the context menu.Task Scheduler (local) > Task Scheduler Library > Microsoft > Office Now navigate to the following location from the left pane inside the Task Scheduler:.Open the Task Scheduler by typing in taskschd.msc in Run.However, the fix for it on Windows 11 is the same: end the scheduled task causing CMD to behave this way.
#Command prompt opening and closing windows 10 windows 10#
This issue was reported to have been around for quite some time and was the same on Windows 10 as well. If you see that the Command Prompt is opening and closing after every fixed interval, it is likely because of the Office Suite scheduled task(s) running in the background. Continue to read further for more possible solutions. If it does, then the missing Environment Variable path is not your issue. Now restart your computer for the changes to take effect.Īfter the computer reboots, check to see if the issue persists.Then click OK on all windows to save and close them. Next, in the Edit environment variable window, click New, then paste the following in the text field:.Now click on Path under the System variables window, and then click Edit.In the System Properties window, switch to the Advanced tab and then click the Environment Variables button at the bottom.Open the System Properties window on your computer by typing in sysdm.cpl in Run.In this particular case, the path to “C:\Windows\SysWow64” is usually missing, which causes the Command Prompt to spontaneously open and close. Add missing Environment Variable path manuallyĪs we mentioned earlier, users that have upgraded to Windows 11 can also experience missing Environment Variable paths. If it does, continue to perform the rest of the mitigation methods below. Once completed, spend some time on your computer to check if the Command Prompt still behaves the same. Do not close the Command Prompt and allow them ample time to run. It can take a few minutes for the commands to execute completely. To do so, launch Command Prompt with administrative privileges and enter the following 3 commands, one after the other: DISM.exe /Online /Cleanup-image /ScanhealthĭISM.exe /Online /Cleanup-image /CheckhealthĭISM.exe /Online /Cleanup-image /Restorehealth Repair Windows images using DISM This method will clear out any unwanted tasks that are of no use anymore. You can try repairing your Windows image in case you upgraded to Windows 11 from an older OS. Fix Command Prompt randomly opens and closes in Windows 11 Repair Windows image