This order works for me without having to hit return.
Code:
dism /online /cleanup-image /restorehealth&sfc/scannow&Dism /Online /Cleanup-Image /RestoreHealth&sfc/scannow&chkdsk /scan&pause
These are my results:
Code:
C:\WINDOWS\system32>dism /online /cleanup-image /restorehealth&sfc/scannow&Dism /Online /Cleanup-Image /RestoreHealth&sfc/scannow&chkdsk /scan&pause
Deployment Image Servicing and Management tool
Version: 10.0.16299.15
Image Version: 10.0.16299.98
[==========================100.0%==========================] The restore operation completed successfully.
The operation completed successfully.
Beginning system scan. This process will take some time.
Beginning verification phase of system scan.
Verification 100% complete.
Windows Resource Protection did not find any integrity violations.
Deployment Image Servicing and Management tool
Version: 10.0.16299.15
Image Version: 10.0.16299.98
[==========================100.0%==========================] The restore operation completed successfully.
The operation completed successfully.
Beginning system scan. This process will take some time.
Beginning verification phase of system scan.
Verification 100% complete.
Windows Resource Protection did not find any integrity violations.
The type of the file system is NTFS.
Volume label is MacBook.
Stage 1: Examining basic file system structure ...
342272 file records processed.
File verification completed.
8254 large file records processed.
0 bad file records processed.
Stage 2: Examining file name linkage ...
47187 reparse records processed.
417424 index entries processed.
Index verification completed.
0 unindexed files scanned.
0 unindexed files recovered to lost and found.
47187 reparse records processed.
Stage 3: Examining security descriptors ...
Security descriptor verification completed.
37577 data files processed.
CHKDSK is verifying Usn Journal...
36927008 USN bytes processed.
Usn Journal verification completed.
Windows has scanned the file system and found no problems.
No further action is required.
111615999 KB total disk space.
87158576 KB in 154401 files.
121344 KB in 37578 indexes.
0 KB in bad sectors.
455815 KB in use by the system.
65536 KB occupied by the log file.
23880264 KB available on disk.
4096 bytes in each allocation unit.
27903999 total allocation units on disk.
5970066 allocation units available on disk.
Press any key to continue . . .
The reason for the duplication is that sfc restores things from the component store and dism repairs the component store (in this case through Windows update). You may find you need to find another source for the dism restorehealth but that is another matter. In any case it is worth running sfc after dism if you want to automate it.
However I would only do any of them if something isn't working. I certainly wouldn't run them weekly on a schedule. Both sfc /scannow
and dism /online /cleanup-image /restorehealth
give false positive results. Especially with graphics drivers and especially after an upgrade (which happens every 6 months).
Unless you want to dig into the logs only to find there is not really an error it is possibly not worth it unless something isn't working. It will certainly not do any harm if you do though.