New
#1
Check the state of the OS and proceed accordingly.
I am at the end of testing customisations for my Win 10 and I thought it would be a nice idea to have the health etc and repair for Win 10 in one location.
I am intending on setting up a folder within my customised TaskBar folder with a shortcut for each item to allow me to have at hand everything needed for this to be achieved. I might even setup a .CMD file for this! This could also be adapted to include it into the Contect Menu as a single menu.
I have tried to include below the CMD and PowerShell commands in case anyone wants the option. I have numbered these in the order that I think they are relevant. I intend to use CMD rather than PowerShell where possible as I am more comfortable with CMD.
If there is anything wrong with any of the below, or you think the order is incorrect, or there is anything else that could be included, then please let me know.
[01] Analyze The Windows WinSXS Component Store_Directory:
Code:Dism.exe /online /Cleanup-Image /AnalyzeComponentStore
[02] Delete WinSXS Obsolete Items:
Code:Dism.exe /online /Cleanup-Image /StartComponentCleanup
[03] Remove ALL WinSXS Superseded Component Versions:
Code:Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
[04] Remove ALL WinSXS Service Pack Backup_Files:
Code:Dism.exe /online /Cleanup-Image /SPSuperseded
[05] CheckHealth of the Win Image - Basic scan to determine if there are any corruptions - [ Live OS ]:
Code:Dism /Online /Cleanup-Image /CheckHealthCode:@="PowerShell.exe -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/s,/k, Dism /Online /Cleanup-Image /CheckHealth' -Verb runAs\""
[06] ScanHealth of the Win Image - Advanced scan to determine if there are any problems - [ Live OS ]:
Code:Dism /Online /Cleanup-Image /ScanHealthCode:@="PowerShell.exe -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/s,/k, Dism /Online /Cleanup-Image /ScanHealth' -Verb runAs\""
[07] RestoreHealth of the Win Image - Advanced scan that repairs any problems - [ Live OS ]:
Code:Dism /Online /Cleanup-Image /RestoreHealthCode:@="PowerShell.exe -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/s,/k, Dism /Online /Cleanup-Image /RestoreHealth' -Verb runAs\""
[08] chkdsk - Read-Only Mode + Detect Mode:
Code:C:\Windows\System32\cmd.exe /k chkdsk C:
[09] chkdsk /F - Repair Mode:
Code:C:\Windows\System32\cmd.exe /k chkdsk C: /F
[10] chkdsk /R - Repair Mode + Scan for Bad Sectors:
Code:C:\Windows\System32\cmd.exe /k chkdsk C: /R
[11] Run sfc /scannow Command at Boot - Allows better repair because files are NOT in use - [ Offline OS ]:
Code:[sfc /scannow /offbootdir=<drive Path>:\ /offwindir=<drive Path>:\Windows
[12] Run sfc /scannow from within Windows - Repair files - [ Live OS ]:
Code:@="PowerShell.exe -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/s,/k, sfc /scannow' -Verb runAs\""
[13] SFC Scan Details Log - View Only the SFC Scan ERROR Results from the CBS.LOG [ Live OS ]:
Code:FindSTR /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%UserProfile%\Desktop\sfc_Details.txt"Code:@="PowerShell.exe (sls [SR] $env:windir\\Logs\\CBS\\CBS.log -s).Line >\"$env:UserProfile\\Desktop\\sfc_Details.txt\""
Thanks in advance.