Windows 8 and 8.1 Forums


Making sfc /scannow .bat file

  1. #1


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center

    Making sfc /scannow .bat file


    The following images show how to make a batch file for sfc /scannow that opens with one or two clicks:

    They are numbered in the order of reading them.

    I numbered them because they never show up in the proper order when attached.


    Click image for larger versionClick image for larger versionClick image for larger versionClick image for larger versionClick image for larger version
    Last edited by David Bailey; 03 Apr 2013 at 06:36.

      My System SpecsSystem Spec

  2. #2


    San Jose - California
    Posts : 2,847
    8.1x64PWMC Ubuntu14.04x64 MintMate17x64


    Thanks for sharing the info. However, a simple way to create a bat file is to right click on the desktop->New->Text Document and enter 2 statements on separate lines: sfc /scannow, pause then save it as RunSFC.bat or whatever you name it.

    NOTE: you need to put a pause statement after sfc /scannow so that the user will have a chance to read the output message, otherwise the command windows just simply closes.
      My System SpecsSystem Spec

  3. #3


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Thanks for the information on adding PAUSE.

    Would that be:

    sfc /scannow, pause

    or

    sfc /scannow
    pause
      My System SpecsSystem Spec

  4. #4


    San Jose - California
    Posts : 2,847
    8.1x64PWMC Ubuntu14.04x64 MintMate17x64


    It should be on separate lines:
    sfc /scannow
    pause

    OR:
    @ sfc /scannow
    @ pause

    OR:
    @ sfc /scannow & pause

    By adding '@' the command will not be echoed in the command windows.
    adding & if you want multiple commands in one line
    Last edited by topgundcp; 03 Apr 2013 at 00:00.
      My System SpecsSystem Spec

  5. #5


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Quote Originally Posted by topgundcp View Post
    It should be on separate lines:
    sfc /scannow
    pause
    Thank you.
      My System SpecsSystem Spec

  6. #6


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center

    Learned new stuff


    I added the PAUSE & it kept the window open.
    It said to press any key to continue.
    I pressed Space bar & the window closed.

    Click image for larger version

    A note to Brink --- I studied the adding of images in proper order & figured it out.
    Thanks for the help.

    Also, I figured out making test posts without posting them.
    I just Preview the test post & make changes as needed & when done close the window.
    I don't clutter up the forum with tests.
    Last edited by David Bailey; 03 Apr 2013 at 06:04. Reason: added more info
      My System SpecsSystem Spec

  7. #7


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center

    Added new Lines to .bat code


    Code:
    sfc /scannow
    PAUSE
    Dism /Online /Cleanup-Image /RestoreHealth
    PAUSE
    Click image for larger version

    The DISM command actually fixes things SFC can't fix.
    See picture:

    Click image for larger version

    Before running it, SFC found un-fixable problems.


    After running it, All problems were fixed.

    See picture:

    Click image for larger version

    If you run sfc /scannow as in the .bat file & see problems not fixed press any key & the DISM command will run & fix the problems.

    Or to be more efficient you could add another sfc /scannow & pause:

    Code:
    sfc /scannow
    PAUSE
    Dism /Online /Cleanup-Image /RestoreHealth
    PAUSE
    sfc /scannow
    PAUSE
    If you wanted to run sfc /scannow again just to be sure things are fixed.
    Last edited by David Bailey; 03 Apr 2013 at 09:40.
      My System SpecsSystem Spec

  8. #8


    Hi, David. Like I wrote you > This is very handy. Thanks for the additions.

    Is it possible to omit the pause so as to start one right after the other?
      My System SpecsSystem Spec

  9. #9


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Quote Originally Posted by HippsieGypsie View Post
    Hi, David. Like I wrote you > This is very handy. Thanks for the additions.

    Is it possible to omit the pause so as to start one right after the other?
    Yes.

    With no pause the next one starts automatically.

    Leave a pause at the end so the window does not disappear.

    Sorry for the late response.
      My System SpecsSystem Spec

Making sfc /scannow .bat file
Related Threads
I just ran "sfc /scannow", got the message "Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log ...". I opened that with texteditor, and found 4 Cannot repair member file "Amd64\CNBJ2530.DPB of prncacla.inf ... lines in the...
Need Help in SFC/Scannow in Performance & Maintenance
Hi, So i itried Sfc/scannow command in cmd and when it has finnished i have got this : 49561 So i have uploaded the CBS.log file and can anybody tell me what is the thing that has not got fixed. Thanks.
Hi, I'm sorry if I post this on wrong section. I'm new & this is my 1st post on this forum :cry: Anyway, I'm curious about making file shortcuts between hard disk. Example, real folder is in D: drive. I want to make a shortcut for that particular folder in E: drive. Is this possible? if yes...
Solved sfc/scannow in Performance & Maintenance
Hi Have just run sfc/scannow and it has found some faults any ideas from the screen shot what I can or need to do, any help advice would be good, I`m not a computer geek! so take pity! Thanks 33039
Scannow fix in Performance & Maintenance
I tried I ran this: Dism /Online /Cleanup-Image /RestoreHealth and this worked perfeftly !!!! Will it work in Windows 7 or do you know what would??? This is by far the easiest...
I have an HP ENVY dt7 running Windows 8, purchased Nov 2012. Have already had to do 1 refresh. As of yesterday, it's again back where it was before the last refresh (IE, Firefox, Outlook won't run). Found your SFC tutorial and ran it. Came back w/unrepaired errors 3x in a row When I tried to...
If you go four levels down: C: \ 1 \ 2 \ 3 \ 4 . . . and right-click on 4 to make a: New / Folder . . . . . . if there are a lot of folders in the right hand pane, and your mouse is hovering over one of them, after you click on the word "Folder," it doesn't do the expected action, to give...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook