Troubleshoot I cannot open cmd anymore

Miki4132

Level 1
Thread author
May 31, 2018
3
Briefly explain your current issue(s)
CMD doesn't open properly and closes fast
Steps taken to resolve, but have been unsuccessful
Malwarebyte scans, Antivirus scans, Microsoft toll for malware removal
Hi all,

I have had this problem with the cmd a while. When I want to open cmd it just pops up and closes very fast. But I have to mention that, cmd doesn't open by itself, just when I want it to. I have Avast free Antivirus and Premium Malwarebyte on my pc installed. I did all the scans and there is apparently no virus on my PC at all. My Processor is i7-6770 Black edition and I have a AMD Radeon graphic card ( worth 400 bucks).

But what I have to mention is, that when I change the user on my PC and sign in with the administrator account, the cmd opens without any problem.

Does anyone know what could it possible be? I even installed the malware removal tool from Microsoft, neither that found any viruses.


Thanks in advance Miki4132
 
I

illumination

Hi all,

I have had this problem with the cmd a while. When I want to open cmd it just pops up and closes very fast. But I have to mention that, cmd doesn't open by itself, just when I want it to. I have Avast free Antivirus and Premium Malwarebyte on my pc installed. I did all the scans and there is apparently no virus on my PC at all. My Processor is i7-6770 Black edition and I have a AMD Radeon graphic card ( worth 400 bucks).

But what I have to mention is, that when I change the user on my PC and sign in with the administrator account, the cmd opens without any problem.

Does anyone know what could it possible be? I even installed the malware removal tool from Microsoft, neither that found any viruses.


Thanks in advance Miki4132
Is the user account you have to change over from a standard account? Are you trying to launch cmd with out right clicking it and running as Admin, requiring a password if on a standard account. Are you the Admin, did you set these accounts up this way.

Need more information in order to help you.
 
Upvote 0

Miki4132

Level 1
Thread author
May 31, 2018
3
Is the user account you have to change over from a standard account? Are you trying to launch cmd with out right clicking it and running as Admin, requiring a password if on a standard account. Are you the Admin, did you set these accounts up this way.

Need more information in order to help you.
Hi, Yes I am trying to start it as a Administrator with the right click on my mouse. But it still won't open. In order to open the cmd I need to logout from my current account and enter as the default administrator account( I have two accounts on my pc)
 
Upvote 0
I

illumination

Hi, thanks I tried this. But it says:
You must be an administrator running a console session in order to
use the sfc utility.
You stated you could run cmd just fine in the admin account, this is where you will need to run the system file check for corruption.
Open CMD with Admin, type: sfc /scannow

You can also run a DISM restore health, both of which you should restart the system after running...
Open CMD, with Admin, type: DISM /Online /Cleanup-Image /RestoreHealth

If you are unable to do either on the system in the admin account, then create a bootable copy of windows with Microsofts media creation tool, burning to a flash drive/disk, insert the removable media, restart your machine and boot from the media, once booted, instead of choosing "Install" chose "Repair" open CMD in the repair section and run these same commands from the bootable media...

If this fails, then either you will need to reimage it from an image you backed up, or is stored on the system, or a clean wipe of HHD and a clean install of windows would be necessary.
 
Upvote 0

Yellowing

Level 5
Verified
Jun 7, 2018
221
I've made a pretty handy batch for people who are using SFC and DISM too much :D
Oh... unfortunately .bat are not allowed to upload here. :unsure: Why is that? You can directly see what they will do with right click + edit. :geek:
 
  • Like
Reactions: frogboy
Upvote 0

Yellowing

Level 5
Verified
Jun 7, 2018
221
Oh! Ok then, here it is: :X3:
Bash:
@echo off

:ENTER
CLS
echo.
echo ================================================================================
echo                        Script for repairing Windows errors
echo ================================================================================
echo                                                                     By Yellowing
echo.
echo   [1] SFC /scannow
echo   [2] or [2p] DISM /StartComponentCleanup and /RestoreHealth
echo   [3] or [3p] Both: First SFC, DISM SCC, DISM RH, then SFC again
echo   ### (If you want it to pause between checks, write "2p" or "3p") ###
echo.
echo   Space or CTRL+C to exit.
echo.
echo.
echo --------------------------------------------------------------------------------
echo WARNING! "DISM /RestoreHealth" will revert many settings you've made to Windows.
echo (Like privacy and security settings) Remember to re-apply them afterwards!
echo.
echo DISM /StartComponentCleanup cleans the WinSXS folder. That can resolve issues.
echo.
echo In case of [3]: It makes sense to run SFC twice because DISM could repair
echo something that held SFC back from repairing something else.
echo --------------------------------------------------------------------------------
echo.
echo.

set run=1
set ask=0
set /p ask="Choose: "

if %ask%==1 goto SFC
if %ask%==2 goto DISM
if %ask%==3 goto BOTH
if %ask%==2p goto DISM
if %ask%==3p goto BOTH
rem echo %ask% | findstr /i /c:"2" >nul && goto DISM || echo %ask% | findstr /i /c:"3" >nul && goto BOTH || goto ENTER
rem It's such a beauty... sadly it needs too much input handling. (ie: ask="32" or "23" would run the checks multiple times)
goto ENTER


:BOTH
echo.
echo.
echo ================================================================================
echo                               Starting all checks...
rem goto SFC


:SFC
echo ================================================================================
echo.
echo.
echo.
echo                                Starting SFC.exe...
echo.
echo %ask% | findstr /i /c:"p" >nul && pause || echo.
@echo on
sfc /scannow
@echo off
echo.
echo.
echo.
set /a run=run+1
if %run%==3 goto END
echo %ask% | findstr /i /c:"3" >nul && goto DISM || goto END
goto END


:DISM
echo ================================================================================
echo.
echo.
echo.
echo                  Starting DISM.exe with /StartComponentCleanup...
echo.
echo %ask% | findstr /i /c:"p" >nul && pause || echo.
@echo on
dism /Online /Cleanup-image /StartComponentCleanup
@echo off
echo.
echo.
echo.
echo ================================================================================
echo.
echo.
echo.
echo                     Starting DISM.exe with /RestoreHealth...
echo.
echo %ask% | findstr /i /c:"p" >nul && pause || echo.
@echo on
dism /Online /Cleanup-image /RestoreHealth
@echo off
echo.
echo.
echo.
echo %ask% | findstr /i /c:"3" >nul && goto SFC || goto END


:END
echo --------------------------------------------------------------------------------
echo -----------------------------------All done!------------------------------------
echo --------------------------------------------------------------------------------
pause
goto ENTER
It is maximum 80 char wide because I think that was standard width of cmd before windows 10, right?
I am not sure if it is necessary to split the dism scan and add another char to the input string to specifically enable /StartComponentCleanup. Tell me :) If you have more things you ...:eek: oh, I just realized I can add anything because it is so easy to choose. Are there more commands to do in a repair situation? :unsure: I would scan the log file for errors and react, but they are so huge.

Coffee! :coffee:
 
  • Like
Reactions: frogboy
Upvote 0

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top