Resource icon

SFC Scannow and Dism RestoreHealth - Image Health - Repair Corrupt Files

Porthos

Well-Known Member
Reaction score
13,229
Location
San Antonio Tx
Porthos submitted a new resource:

SFC Scannow and Dism RestoreHealth - Image Health - Repair Corrupt Files - SFC Scannow and Dism RestoreHealth - Image Health - Repair Corrupt Files

Credit goes to Kyhi at
https://www.tenforums.com/software-apps/27180-windows-10-recovery-tools-bootable-rescue-disk.html

SFC Scannow and Dism RestoreHealth - Image Health - Repair Corrupt Files

Here is a program to help users with corrupt windows files..
This program will run System File Checker and DISM commands to repair an online Windows image
and will also look for the setup media to use as a repair source

Step 1: Download and Extract > IMAGE_HEALTH to a root folder...

Read more about this resource...
 
Thanks. I was really thinking of something that would handle all those other cool options too (basically, all the non-DISM dependant ones). I know you can run them all individually if you think you need to, but would be nice to have them all available in one place.
 
SFCFixScript.txt is not available. :(

It's not needed. There's not much documentation on SFCFix as the guys at sysnative are usually pretty tight-lipped about it unless they're helping resolve a problem (they're great over there btw). But the basics of it are as follows:

1. Remove the entire contents of the /windows/logs/cbs directory. You can send it to recycle bin if you want. Win10 1703 requires some permissions editing to do this because the logs folder is locked down now by default (thanks M$!)

2. Run the regular sfc /scannow command in an elevated command prompt/powershell and wait for it to complete.

3. Once it completes, run the SFCFix utility. Read/advance through the prompts and let it do it's thing. Once finished, it will produce a log file telling you what it found wrong. In some cases it may be able to fix the issues on it's own. However many times if it's a corrupted file or files it'll give you a listing of the ones that need replacing.

4. If there are files that need replacing, you'll need to pull them from a matching build version of Windows. The file name must match exactly and the build also needs to be correct to make sure you've got the right set of files (not doing this can introduce problems).

5. Now here's the part where this tool gets powerful, by using scripts you can tell the utility to do different things (thus where the SFCFixscript.txt comes in). I've only scratched the surface when it comes to what can be done with this thing but it's still useful just in the example I'm giving here. Once you've got the files pulled and collected from the matching build, you'll need to create a small script to tell the utility where to put them. Normally, I just have this script saved along with the utility on my repair flash drive so it's always handy. My particular script looks like this:

Code:
PowerCopy::
{ARCHIVE} %SystemRoot% [DIR]

You can modify the second line to point to a more specific directory if you want, I just recreate the folder structure starting with sysroot usually just in case one of the folders along the way doesn't exist.

6. Now we need to create a zip archive containing both the files and the script you just created. The root of the zip file should be treated as the directory that you're referencing in your script. So, for example, if I'm replacing a file in the WinSxS folder using the above script, my zip file structure would look like this:

Code:
*.zip
|
\ SFCFixScript.txt
|
\WinSxS\troublefolder\troublefiles

7. Now you'll just need to drag that zip file onto the utility and drop it there, wait about 10 seconds for it to work, reboot and you're done! Problem solved.


I know it sounds complex but it's really pretty simple once you do it and understand how it works. Additionally, there's all kinds of other scripts that can be written for it but again, sysnative are pretty tight-lipped about it so there's no real documentation or anything. Lurk around their forums enough though and you'll glean enough info about it to make it useful.
 
  • Like
Reactions: GTP
It's not needed. There's not much documentation on SFCFix as the guys at sysnative are usually pretty tight-lipped about it unless they're helping resolve a problem (they're great over there btw). But the basics of it are as follows:

1. Remove the entire contents of the /windows/logs/cbs directory. You can send it to recycle bin if you want. Win10 1703 requires some permissions editing to do this because the logs folder is locked down now by default (thanks M$!)

2. Run the regular sfc /scannow command in an elevated command prompt/powershell and wait for it to complete.

3. Once it completes, run the SFCFix utility. Read/advance through the prompts and let it do it's thing. Once finished, it will produce a log file telling you what it found wrong. In some cases it may be able to fix the issues on it's own. However many times if it's a corrupted file or files it'll give you a listing of the ones that need replacing.

4. If there are files that need replacing, you'll need to pull them from a matching build version of Windows. The file name must match exactly and the build also needs to be correct to make sure you've got the right set of files (not doing this can introduce problems).

5. Now here's the part where this tool gets powerful, by using scripts you can tell the utility to do different things (thus where the SFCFixscript.txt comes in). I've only scratched the surface when it comes to what can be done with this thing but it's still useful just in the example I'm giving here. Once you've got the files pulled and collected from the matching build, you'll need to create a small script to tell the utility where to put them. Normally, I just have this script saved along with the utility on my repair flash drive so it's always handy. My particular script looks like this:

Code:
PowerCopy::
{ARCHIVE} %SystemRoot% [DIR]

You can modify the second line to point to a more specific directory if you want, I just recreate the folder structure starting with sysroot usually just in case one of the folders along the way doesn't exist.

6. Now we need to create a zip archive containing both the files and the script you just created. The root of the zip file should be treated as the directory that you're referencing in your script. So, for example, if I'm replacing a file in the WinSxS folder using the above script, my zip file structure would look like this:

Code:
*.zip
|
\ SFCFixScript.txt
|
\WinSxS\troublefolder\troublefiles

7. Now you'll just need to drag that zip file onto the utility and drop it there, wait about 10 seconds for it to work, reboot and you're done! Problem solved.


I know it sounds complex but it's really pretty simple once you do it and understand how it works. Additionally, there's all kinds of other scripts that can be written for it but again, sysnative are pretty tight-lipped about it so there's no real documentation or anything. Lurk around their forums enough though and you'll glean enough info about it to make it useful.
Great, thanks for the help! :)
 
Back
Top