How to run ChkDsk during OSD ? RRS feed

  • Question

  • I have in my TS a step if the Apply OS step fails to run ChkDsk. Maybe I'm missing something here because it seems to not work correctly.

    It would be in WinPE when it tries to run ChkDsk.

    Command line: 

    cmd.exe /c CHKDSK "C:" /F /R /X (I'm not sure this is the correct syntax)


    cmd.exe /c CHKDSK "C:" /R   (This option seems to work but on successful run it exits with an exit code 1 which triggers a fail in the TS)

     Anyone have experience with this as to which should be the correct command line options to run from the WinPE stage during OSD ?

    The purpose is to correct any bad issues on the hard drive before a retry of applying the OS. I ran into this problem yesterday where the Apply OS step failed because of some bad sectors on drive.

    Thanks for any helpful input on running ChkDsk during OSD

    • Edited by LB_3 Tuesday, October 15, 2013 11:13 PM .
    Tuesday, October 15, 2013 4:23 PM


  • Thanks for both of the suggestions.

    I think I will go with cmd.exe /c CHKDSK "C:" /R and then handle the error code as suggested

    I think that cmd.exe /c CHKDSK "C:" /F /R /X may need a restart to actually run chkdsk after this command.

    • Marked as answer by Joyce L Wednesday, October 30, 2013 1:15 AM
    Wednesday, October 16, 2013 6:51 PM
  • Yes, I used the /R option and basically for now I chose to ignore the error. The above suggestions would work as it does handle the exit code properly. The chkdsk only runs in my TS when the first "Apply OS" fails which would mean in most cases there's errors on disk. Then chkdsk runs followed by a second attempt to apply OS.

    chkdsk is running from WinPE with this command line:

    cmd.exe /c x:\windows\system32\chkdsk c: /R

    In my testing I monitor the SMSTS.log file as chkdsk is running because it does take quite a while.

    Thanks for the suggestions and tips.

    • Marked as answer by Joyce L Wednesday, October 30, 2013 1:15 AM
    Tuesday, October 29, 2013 8:11 PM

All replies