CMD and PowerShell are not opening

Mina 0 Reputation points
2024-03-25T16:27:22.57+00:00

I have a problem with either CMD and PowerShell. Recently when I try to open any of them, a blank window is shown for a few seconds, then closes. I tried also to open as an administrator, it opens directly without the Security Warning message, also blank and closes after a few seconds. I am running on Windows 11 Pro, and have only Windows Defender as an antivirus. I went om safe mode and run CMD, it opened without a problem. I run sfc /scannow , it found and fixed some problems. After I restarted into normal mode and tried to open any of CMD or PowerShell again, still blank window then closes automatically. Please help me.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,685 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jing Zhou 7,095 Reputation points Microsoft Vendor
    2024-03-26T03:56:56.3766667+00:00

    Hello,

    Thank you for posting in Q&A forum.

    The problem you are experiencing may be caused by system file corruption or other software conflicts. Here are some possible solutions:

    Run the DISM tool: Open a command prompt (with administrator privileges) and run the following command: DISM/Online/Cleanup Image/RestoreHealth. This will scan and repair any damage in the system image.

    Re register CMD and PowerShell: Run the following command from the command prompt or PowerShell: sfc/scannow. This will scan system files and attempt to repair any damaged files.

    Check for third-party software conflicts: Temporarily disable all third-party antivirus and security software, and try reopening CMD or PowerShell. If the problem is resolved, enable third-party software one by one to determine if there are any conflicts related to it.

    Create a new user account: Create a new local user account and try logging in and opening CMD or PowerShell using that account to see if the same problem still occurs.

    System Restore: If none of the above methods are effective, you can try using System Restore to restore the system to a state where there were no issues before.

    Hope this answer can help you well.

    Best regards,

    Jill Zhou

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.