Forums
New posts
Search forums
News
Security News
Technology News
Giveaways
Giveaways, Promotions and Contests
Discounts & Deals
Reviews
Users Reviews
Video Reviews
Support
Windows Malware Removal Help & Support
Mac Malware Removal Help & Support
Mobile Malware Removal Help & Support
Blog
Log in
Register
What's new
Search
Search titles only
By:
Search titles only
By:
Reply to thread
Menu
Install the app
Install
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Software
Software Troubleshooting
I cannot open cmd anymore
Message
<blockquote data-quote="Yellowing" data-source="post: 741112" data-attributes="member: 72894"><p>Oh! Ok then, here it is: :X3:</p><p>[CODE=bash]@echo off</p><p></p><p>:ENTER</p><p>CLS</p><p>echo.</p><p>echo ================================================================================</p><p>echo Script for repairing Windows errors</p><p>echo ================================================================================</p><p>echo By Yellowing</p><p>echo.</p><p>echo [1] SFC /scannow</p><p>echo [2] or [2p] DISM /StartComponentCleanup and /RestoreHealth</p><p>echo [3] or [3p] Both: First SFC, DISM SCC, DISM RH, then SFC again</p><p>echo ### (If you want it to pause between checks, write "2p" or "3p") ###</p><p>echo.</p><p>echo Space or CTRL+C to exit.</p><p>echo.</p><p>echo.</p><p>echo --------------------------------------------------------------------------------</p><p>echo WARNING! "DISM /RestoreHealth" will revert many settings you've made to Windows.</p><p>echo (Like privacy and security settings) Remember to re-apply them afterwards!</p><p>echo.</p><p>echo DISM /StartComponentCleanup cleans the WinSXS folder. That can resolve issues.</p><p>echo.</p><p>echo In case of [3]: It makes sense to run SFC twice because DISM could repair</p><p>echo something that held SFC back from repairing something else.</p><p>echo --------------------------------------------------------------------------------</p><p>echo.</p><p>echo.</p><p></p><p>set run=1</p><p>set ask=0</p><p>set /p ask="Choose: "</p><p></p><p>if %ask%==1 goto SFC</p><p>if %ask%==2 goto DISM</p><p>if %ask%==3 goto BOTH</p><p>if %ask%==2p goto DISM</p><p>if %ask%==3p goto BOTH</p><p>rem echo %ask% | findstr /i /c:"2" >nul && goto DISM || echo %ask% | findstr /i /c:"3" >nul && goto BOTH || goto ENTER</p><p>rem It's such a beauty... sadly it needs too much input handling. (ie: ask="32" or "23" would run the checks multiple times)</p><p>goto ENTER</p><p></p><p></p><p>:BOTH</p><p>echo.</p><p>echo.</p><p>echo ================================================================================</p><p>echo Starting all checks...</p><p>rem goto SFC</p><p></p><p></p><p>:SFC</p><p>echo ================================================================================</p><p>echo.</p><p>echo.</p><p>echo.</p><p>echo Starting SFC.exe...</p><p>echo.</p><p>echo %ask% | findstr /i /c:"p" >nul && pause || echo.</p><p>@echo on</p><p>sfc /scannow</p><p>@echo off</p><p>echo.</p><p>echo.</p><p>echo.</p><p>set /a run=run+1</p><p>if %run%==3 goto END</p><p>echo %ask% | findstr /i /c:"3" >nul && goto DISM || goto END</p><p>goto END</p><p></p><p></p><p>:DISM</p><p>echo ================================================================================</p><p>echo.</p><p>echo.</p><p>echo.</p><p>echo Starting DISM.exe with /StartComponentCleanup...</p><p>echo.</p><p>echo %ask% | findstr /i /c:"p" >nul && pause || echo.</p><p>@echo on</p><p>dism /Online /Cleanup-image /StartComponentCleanup</p><p>@echo off</p><p>echo.</p><p>echo.</p><p>echo.</p><p>echo ================================================================================</p><p>echo.</p><p>echo.</p><p>echo.</p><p>echo Starting DISM.exe with /RestoreHealth...</p><p>echo.</p><p>echo %ask% | findstr /i /c:"p" >nul && pause || echo.</p><p>@echo on</p><p>dism /Online /Cleanup-image /RestoreHealth</p><p>@echo off</p><p>echo.</p><p>echo.</p><p>echo.</p><p>echo %ask% | findstr /i /c:"3" >nul && goto SFC || goto END</p><p></p><p></p><p>:END</p><p>echo --------------------------------------------------------------------------------</p><p>echo -----------------------------------All done!------------------------------------</p><p>echo --------------------------------------------------------------------------------</p><p>pause</p><p>goto ENTER[/CODE]</p><p>It is maximum 80 char wide because I think that was standard width of cmd before windows 10, right?</p><p>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 <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite109" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> If you have more things you ...<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite117" alt=":eek:" title="Eek! :eek:" loading="lazy" data-shortname=":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? <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite132" alt=":unsure:" title="Unsure :unsure:" loading="lazy" data-shortname=":unsure:" /> I would scan the log file for errors and react, but they are so huge.</p><p></p><p>Coffee! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite134" alt=":coffee:" title="Coffee :coffee:" loading="lazy" data-shortname=":coffee:" /></p></blockquote><p></p>
[QUOTE="Yellowing, post: 741112, member: 72894"] Oh! Ok then, here it is: :X3: [CODE=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[/CODE] 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: [/QUOTE]
Insert quotes…
Verification
Post reply
Top