Сканировать систему на наличие ошибок командная строка

Windows 8.1 Windows 8.1 Enterprise Windows 8.1 Pro Windows 8 Windows 8 Enterprise Windows 8 Pro Windows 7 Enterprise Windows 7 Home Basic Windows 7 Home Premium Windows 7 Professional Windows 7 Starter Windows 7 Ultimate Windows Vista Enterprise 64-bit Edition Windows Vista Ultimate 64-bit Edition Windows Vista Business Windows Vista Business 64-bit Edition Windows Vista Enterprise Windows Vista Ultimate Windows 10 Еще…Меньше

Если некоторые функции Windows не работают или Windows завершает работу, используйте средство проверки системных файлов для сканирования Windows и восстановления файлов.  

 
Несмотря на то, что приведенные ниже шаги могут показаться сложными на первом этапе, просто выполните их по порядку, и мы попробуем помочь вам.

Запуск средства проверки системных файлов (SFC.exe)

выполнив указанные ниже действия.

  1. Откройте командную строку с повышенными привилегиями. Для этого выполните указанные ниже действия, в зависимости от версии операционной системы:

  2. Пользователям Windows 10, Windows 8.1 или Windows 8 перед запуском средства проверки системных файлов нужно запустить систему обслуживания образов развертывания и управления ими (DISM).  (Если на вашем компьютере установлена система Windows 7 или Windows Vista, перейдите сразу к шагу 3.) 

Введите следующую команду и нажмите клавишу ВВОД.  Выполнение команды может занять несколько минут.

DISM.exe /Online /Cleanup-image /Restorehealth

Важно! При запуске этой команды DISM обращается к Центру обновления Windows, чтобы получить файлы для устранения повреждений. Но если поврежден клиент Центра обновления Windows, используйте работающий экземпляр Windows в качестве источника восстановления либо параллельную папку Windows из сетевого расположения или со съемного носителя, например DVD-диска Windows, в качестве источника файлов. Для этого введите в командной строке такую команду:

DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:C:RepairSourceWindows /LimitAccess

Примечание. Вместо заполнителя C:RepairSourceWindows укажите расположение вашего источника восстановления. Дополнительные сведения об использовании средства DISM для восстановления Windows см. в статье Восстановление образа Windows.

  1. Введите в командной строке приведенную ниже команду и нажмите клавишу ВВОД:

sfc /scannow


Командной строки с правами администратора - sfc/scannow 
 

Команда sfc /scannow проверит все защищенные системные файлы и заменит поврежденные файлы их кэшированной копией, расположенной в сжатой папке по адресу %WinDir%System32dllcache.
Заполнитель %WinDir% представляет собой папку операционной системы Windows. Например, C:Windows.

Примечание. Не закрывайте это окно командной строки, пока проверка не завершится на 100 %. Результаты проверки будут показаны после завершения данного процесса.

  1. После завершения процесса проверки на экране может появиться одно из приведенных ниже сообщений:

    • Защита ресурсов Windows не обнаружила нарушений целостности.


      Это значит, что отсутствующие и поврежденные системные файлы не обнаружены.

    • Защита ресурсов Windows не может выполнить запрошенную операцию.


      Для устранения этой проблемы выполните сканирование с помощью средства проверки системных файлов в безопасном режиме, убедитесь, что папки PendingDeletes и PendingRenames находятся в папке %WinDir%WinSxSTemp.

    • Защита ресурсов Windows обнаружила поврежденные файлы и успешно их восстановила. Сведения см. в журнале CBS.Log %WinDir%LogsCBSCBS.log.


      Для просмотра подробных сведений о сканировании и восстановлении системных файлов перейдите к разделу Как просмотреть подробные сведения процесса работы средства проверки системных файлов.

    • Защита ресурсов Windows обнаружила поврежденные файлы, но не может восстановить некоторые из них. Сведения см. в журнале CBS.Log %WinDir%LogsCBSCBS.log.


      Для восстановления поврежденных файлов вручную просмотрите подробные сведения процесса работы средства проверки системных файлов, чтобы найти поврежденный файл, а затем вручную заменить поврежденный файл гарантировано работоспособной копией.

Проведите пальцем от правого края экрана к центру и коснитесь кнопки Поиск. Либо, если вы используете мышь, переместите указатель в правый нижний угол экрана и щелкните кнопку Поиск. Введите запрос Командная строка в поле Поиск, щелкните правой кнопкой мыши элемент Командная строка, затем выберите команду Запуск от имени администратора. Если система запросит пароль администратора или подтверждение, введите пароль или нажмите кнопку Разрешить.
Command prompt - Run as administrator (Windows 8 or 8.1) 

Для этого нажмите кнопку Пуск, введите запрос Командная строка или cmd в поле Поиск, щелкните правой кнопкой мыши элемент Командная строка, а затем выберите команду Запуск от имени администратора. При получении запроса на ввод пароля администратора или подтверждения введите пароль или нажмите кнопку Разрешить.
Запрос команды - Запуск от имени администратора 

Дополнительная информация

Просмотр подробных сведений о процессе работы средства проверки системных файлов.

Чтобы ознакомиться с подробными сведениями, включенными в файл CBS.Log, вы можете скопировать сведения в файл Sfcdetails.txt с помощью команды Findstr, а затем просмотреть их в этом файле. Для этого выполните указанные ниже действия.

  1. Откройте командную строку с повышенными привилегиями, как это описано на шаге 1.

  2. Введите в командной строке приведенную ниже команду и нажмите клавишу ВВОД:

    findstr /c:"[SR]" %windir%LogsCBSCBS.log >"%userprofile%Desktopsfcdetails.txt" 

    Примечание. В файле Sfcdetails.txt содержатся сведения о каждом запуске средства проверки системных файлов на компьютере. Он также содержит информацию о файлах, которые не были исправлены средством проверки системных файлов. Проверьте дату и время записей, чтобы определить проблемные файлы, обнаруженные при последнем запуске средства проверки системных файлов.

  3. Откройте файл Sfcdetails.txt на рабочем столе.

  4. В файле Sfcdetails.txt используется следующий формат:

    Сведения о дате и времени SFC
    В следующем примере файла журнала содержится запись для одного файла, который не удалось исправить:

    2007-01-12 12:10:42, Info CSI 00000008 [SR] Cannot
    repair member file [l:34{17}]»Accessibility.dll» of Accessibility, Version =
    6.0.6000.16386, pA = PROCESSOR_ARCHITECTURE_MSIL (8), Culture neutral,
    VersionScope neutral, PublicKeyToken = {l:8 b:b03f5f7f11d50a3a}, Type
    neutral, TypeName neutral, PublicKey neutral in the store, file is missing


Как вручную заменить поврежденный системный файл гарантированно работоспособной копией файла.

После определения, какой системный файл поврежден и не может быть восстановлен, с помощью подробных сведений в файле Sfcdetails.txt, выясните расположение поврежденного файла, затем вручную замените поврежденный файл его гарантировано работоспособной копией. Для этого выполните указанные ниже действия.

Примечание. Гарантировано работоспособную копию системного файла можно взять с другого компьютера, на котором установлена такая же, как на вашем компьютере версия Windows. Чтобы убедиться в работоспособности системного файла, который вы планируете скопировать на другом компьютере, можно провести процесс проверки средством проверки системных файлов.

  1. Распространите на поврежденный системный файл права собственности администратора. Для этого скопируйте, а затем вставьте (или введите) в командную строку с повышенными привилегиями приведенную ниже команду, затем нажмите клавишу ВВОД:

    takeown /f Путь_и_имя_файла
    Примечание. Заполнитель Путь_и_имя_файла представляет собой путь и имя файла для поврежденного файла. Например, введите takeown /f C:windowssystem32jscript.dll. 
    Командная строка администратора права - команда успешно выполнена

  2. Предоставьте администраторам полный доступ к поврежденному системному файлу. Для этого скопируйте и вставьте (или введите) приведенную ниже команду и нажмите клавишу ВВОД:

    icacls Путь_и_имя_файла /GRANT ADMINISTRATORS:F
    Примечание. Заполнитель Путь_и_имя_файла представляет собой путь и имя файла для поврежденного файла. Например, введите icacls C:windowssystem32jscript.dll /grant administrators:F.
    Командной строки с правами администратора

  3. Замените поврежденный системный файл гарантировано работоспособной копией файла. Для этого скопируйте и вставьте (или введите) приведенную ниже команду и нажмите клавишу ВВОД:

    Copy Исходный_файл Расположение
    Примечание. Заполнитель Исходный_файл представляет собой путь и имя гарантировано работоспособной копии файла на вашем компьютере, а заполнитель Расположение представляет собой путь и имя поврежденного файла. Например, введите copy E:tempjscript.dll C:windowssystem32jscript.dll.

Если описанные выше действия не помогли, возможно, потребуется переустановить Windows. Дополнительные сведения см . в разделе Варианты восстановления Windows10.

Нужна дополнительная помощь?

Нужны дополнительные параметры?

Изучите преимущества подписки, просмотрите учебные курсы, узнайте, как защитить свое устройство и т. д.

В сообществах можно задавать вопросы и отвечать на них, отправлять отзывы и консультироваться с экспертами разных профилей.

Средство проверки системных файлов — это служебная программа в Windows, которая проверяет наличие проблем с файлами на компьютере. Чтобы запустить ее, выполните следующие действия.

  1. Убедитесь, что установлены последние обновления для Windows, а затем перезапустите компьютер. Дополнительные сведения см. в статье Обновление Windows.

  2. В поле поиска на панели задач введите командную строку и щелкните правой кнопкой мыши или нажмите и удерживайте командную строку (классическое приложение) в списке результатов. Выберите Запуск от имени администратора, а затем —Да.

  3. Введите DISM.exe /Online /Cleanup-image /Restorehealth (обратите внимание на пробел перед каждой косой чертой «/»), а затем нажмите ВВОД. (Примечание. Запуск и завершение этого шага может занять несколько минут.)

  4. После того как появится сообщение «Операция успешно завершена», введите sfc /scannow (обратите внимание на пробел между «sfc» и «/») и нажмите клавишу ВВОД.

  5. Когда появится сообщение «Проверка 100 % завершена», введите exit и нажмите клавишу ВВОД.

Дополнительные сведения о системной проверке файлов

Нужна дополнительная помощь?

Нужны дополнительные параметры?

Изучите преимущества подписки, просмотрите учебные курсы, узнайте, как защитить свое устройство и т. д.

В сообществах можно задавать вопросы и отвечать на них, отправлять отзывы и консультироваться с экспертами разных профилей.

Просмотров 132к. Опубликовано 29 июня, 2018 Обновлено 23 августа, 2018

Sfc /scannow — это команда командной строки, которая позволяет сканировать вашу систему Windows на наличие ошибок и исправлять их.

Sfc /scannow проверит все важные файлы Windows на вашем компьютере, включая файлы Windows DLL . Если System File Checker обнаружит проблему с любым из этих защищенных файлов, она заменит ее.

System File Checker — очень полезный инструмент для использования, когда вы подозреваете проблемы с защищенными файлами Windows, например, со многими DLL-файлами .

Выполните следующие шаги для использования sfc с параметром scannow для восстановления важных файлов Windows:

Как использовать SFC /Scannow

  1. Откройте командную строку от имени администратора , которую часто называют «повышенной» командной строкой.
    Важно: для правильной работы команды sfc /scannow она должна выполняться из окна с расширенными командами в Windows 10 , Windows 8 , Windows 7 и Windows Vista . Это не требуется в предыдущих версиях Windows.
  2. После появления командной строки введите следующую команду и нажмите Enter .
    sfc /scannow

    Совет. Между sfc и /scannow есть пробел . Выполнение команды sfc с ее рядом с ней (без пробела) может привести к ошибке.

  3. System File Checker теперь проверит целостность каждого защищенного файла операционной системы на вашем компьютере. Это может занять довольно много времени, чтобы закончить.
  4. Как только проверка достигнет 100%, вы увидите что-то подобное в окне командной строки, предполагая, что проблемы были найдены и исправлены:
    Защита ресурсов Windows обнаружила поврежденные файлы и успешно восстановила их. Подробности включены в CBS.Log windir  Logs  CBS  CBS.log. Например, C:  Windows  Logs  CBS  CBS.log. Обратите внимание, что регистрация в настоящее время не поддерживается в сценариях автономного обслуживания.

    … или что-то вроде этого, если не было найдено никаких проблем:

    Защита ресурсов Windows не обнаружила нарушений целостности.

    Совет. В некоторых ситуациях, чаще всего в Windows XP и Windows 2000, вам также может понадобиться доступ к исходному установочному компакт-диску Windows или DVD в какой-то момент во время этого процесса.

  5. Перезагрузите компьютер, если sfc /scannow действительно восстановил файлы.
    Примечание. Средство проверки системных файлов может или не может запрашивать перезапуск, но даже если это не так, вы должны перезапустить все равно.
  6. Повторите любой процесс, вызвавший исходную проблему, чтобы проверить, исправляет ли sfc /scannow проблему.

Синтаксис команды Sfc

Его базовая форма, это синтаксис, необходимый для выполнения параметров System File Checker:

Параметры sfc [= полный путь к файлу]

Или, точнее, это то, что похоже на опции:

sfc [/scannow] [/verifyonly] [/scanfile=file] [/verifyfile=file] [/offbootdir=boot] [/offwindir=win] [/?]

/scannow Этот параметр указывает sfc сканировать все защищенные файлы операционной системы и при необходимости исправлять.
/verifyonly Этот параметр команды sfc совпадает с  / scannow,  но без ремонта.
/scanfile=file Этот параметр sfc такой же, как  / scannow,  но проверка и восстановление — только для указанного  файла .
/offbootdir=boot Используется с  / offwindir , эта опция sfc используется для определения загрузочного каталога ( загрузки ) при использовании sfc из-за пределов Windows.
/offwindir=win Этот параметр sfc используется с  / offbootdir  для определения каталога Windows ( win ) при использовании sfc в автономном режиме.
/? Используйте  справочный переключатель  с помощью команды sfc, чтобы показать подробную справку о нескольких параметрах команды.
/? Используйте  справочный переключатель  с помощью команды sfc, чтобы показать подробную справку о нескольких параметрах команды.

Примеры команд Sfc

sfc /scannow

В приведенном выше примере утилита System File Checker используется для сканирования, а затем автоматически заменяет любые поврежденные или отсутствующие системные файлы. Опция / scannow является наиболее часто используемым коммутатором для команды sfc.

sfc /scanfile=c:windowssystem32ieframe.dll

Команда sfc, приведенная выше, используется для сканирования ieframe.dll, а затем восстанавливает ее, если проблема обнаружена.

sfc /scannow /offbootdir=c: /offwindir=c:windows

В следующем примере защищенные файлы Windows сканируются и восстанавливаются при необходимости ( / scannow ), но это делается с другой установкой Windows ( / offwindir = c: windows ) на другом диске ( / offbootdir = c: ) ,

sfc /verifyonly

Используя команду sfc с параметром / verifyonly , System File Checker проверит все защищенные файлы и сообщит о любых проблемах, но никаких изменений не будет.

Как интерпретировать файл CBS.log

Каждый раз, когда вы запускаете System File Checker, создается файл LOG, в котором содержится подробный список всех проверенных файлов и каждая операция восстановления, если таковая имеется.

Предполагая, что Windows установлена ​​на диске C: (обычно это так), файл журнала можно найти в C: Windows Logs CBS CBS.log  и открыть с помощью Блокнота или другого текстового редактора . Этот файл может быть полезен для расширенного поиска неисправностей или в качестве ресурса для технолога, который может помочь вам.

Как сканировать и восстанавливать системные файлы в Windows 10

Следующая команда выполнит полное сканирование защищенных системных файлов на вашем компьютере и исправьте любой файл, вызывающий проблемы, в то время как Windows 10 запущена и работает.

  1. Используйте комбинацию клавиш клавиатуры Windows + X, чтобы открыть меню «Power User» и выберите « Командная строка» (Admin) , так как вам понадобятся права администратора для запуска SFC.
  2. В командной строке введите следующую команду и нажмите Enter :sfc /scannowSfc / scannow
  3. По завершении проверки вы увидите одно из следующих сообщений:

Защита ресурсов Windows не обнаружила нарушений целостности: это означает, что в вашей системе отсутствуют какие-либо недостающие или поврежденные файлы.

Защита ресурсов windows не может выполнить запрошенную операцию: это сообщение означает, что во время сканирования возникла проблема, как  исправить эту ошибку смотрите здесь.

Защита ресурсов Windows обнаружила поврежденные файлы и успешно восстановила их. Подробности включены в CBS.Log% WinDir% Logs CBS CBS.log: вы получите это сообщение, когда SFC сможет исправить эту проблему. Теперь вы можете перейти или просмотреть журналы, чтобы получить более подробную информацию.

Windows Resource Protection обнаружила поврежденные файлы, но не смогла исправить некоторые из них. Подробности включены в CBS.Log% WinDir% Logs CBS CBS.log: в этом случае вам необходимо восстановить поврежденные файлы вручную.

Как сканировать и восстанавливать системные файлы в Windows 10 в автономном режиме

Иногда защищенные системные файлы, которые необходимо восстановить, загружаются в память во время работы Windows 10. Если это так, вы можете запустить SFC в автономном режиме, чтобы исправить ваш компьютер.

  1. Используйте комбинацию клавиш клавиатуры Windows + I, чтобы открыть приложение «Настройки».
  2. Нажмите « Обновить» и «Безопасность» .
  3. Нажмите « Восстановление» .
  4. В разделе «Расширенный запуск» нажмите « Перезагрузить сейчас» .
  5. Нажмите « Устранение неполадок» .
  6. Нажмите « Дополнительные параметры» .
  7. Нажмите « Командная строка», чтобы загрузить компьютер только с помощью командной строки.advanced-cmd-windows
  8. При перезагрузке вам будет предложено ввести свое имя пользователя и пароль для продолжения.
  9. Всякий раз, когда вам нужно запускать SCF за пределами Windows, вам нужно сообщить утилите, где находятся файлы установки Windows. В командной строке введите следующую команду, чтобы понять расположение разделов Windows и системного резервирования.wmic logicaldisk get deviceid, volumename, descriptionwmic-logicaldisk-windows
  10. Введите следующую команду и нажмите Enter :sfc /scannow /offbootdir=C: /offwindir=D:WindowsПримечание. Мы используем переключатель / offboodir для указания буквы диска раздела System Reserved, который в этом случае является C , а переключатель / offwindir указывает расположение файлов Windows, в этом случае это D: Windows ,Имейте в виду, что при загрузке компьютера с помощью командной строки буквы дисков могут быть разными, поэтому вам нужно использовать команду на шаге 9 . Однако большую часть времени при работе с Windows 10, D: обычно является буквой диска для установки, а C: является буквой для раздела System Reserved.
  11. По завершении проверки закройте командную строку.
  12. Нажмите « Продолжить», чтобы выйти и вернуться в Windows 10.

Как восстановить системные файлы вручную в Windows 10

Если System File Checker не может исправить один или несколько файлов, вам необходимо будет их восстановить вручную.

Откройте файл sfclogs.txt, чтобы определить, какие поврежденные файлы, найти, где они находятся, выполнив простой поиск файлов или использовать предпочтительную поисковую систему Интернета, чтобы получить более подробную информацию. Затем следуйте приведенным ниже инструкциям, чтобы заменить поврежденный файл.

Быстрый совет. Вы можете найти известные копии системных файлов на другом компьютере с той же версией операционной системы, что и на вашем компьютере.

  1. Используйте комбинацию клавиш клавиатуры Windows + X, чтобы открыть меню «Power User» и выберите « Командная строка» («Администратор») .
  2. Возьмите на себя ответственность за поврежденный системный файл. В командной строке введите следующую команду и нажмите Enter :takeown /f C:Path-and-File-NameПримечание. Замените C:Path-and-File-Name на путь и имя поврежденного файла. Например, C:WindowsSystem32appraiser.dll .
  3. Разрешить полный доступ администратора к поврежденному файлу с помощью следующей команды и нажмите Enter :icacls C:Path-and-File-Name /Grant Administrators:F
  4. Замените файл с хорошей копией, используя следующую команду и нажмите Enter :copy C:Path-SOURCE-and-File-Name C:Path-DESTINATION-and-File-Name Примечание: вам нужно заменить C: Path-SOURCE-и-File-Name исходным путем и именем файла известного хорошего файла, а также заменить C: Path-DESTINATION-and-File-Name на путь назначения и имя поврежденного файла. Вот пример: copy D: Files appraiser.dll C: Windows System32 appraiser.dll .
  5. Введите « Да» и нажмите « Ввод», чтобы подтвердить перезапись.sfc-windows

После замены файла вы можете ввести SFC /verifyonlyкоманду и нажать Enter в командной строке, чтобы проверить целостность всех системных файлов, чтобы узнать, исправлена ​​ли проблема. В качестве альтернативы, если вы отремонтировали только несколько файлов, вы можете проверить целостность каждого файла с помощью sfc /VERIFYFILE=C:Path-and-File-Nameкоманды (например, sfc /VERIFYFILE=C:WindowsSystem32kernel32.dll).

Имейте в виду, что вы не ограничены использованием этой утилиты в Windows 10, SFC — это инструмент командной строки, доступный в предыдущих версиях операционной системы. Тем не менее, вы можете найти различные функции в зависимости от версии, которую вы используете. В командной строке (Admin) используйте sfc /?команду для отображения доступных вам функций.

Как использовать инструмент Scannow SFC в Windows XP

Windows XP имеет возможность защитить себя от нестабильности системы, вызванной сторонним программным обеспечением, переписывающим важные системные файлы.

Раньше это было (и по-прежнему на самом деле), проблема с Windows 95 и Windows 98.

С введением Windows Millennium Edition Microsoft предприняла настоящие усилия, чтобы остановить это.

Теперь в Windows XP у нас есть гораздо более совершенная защита этих важных файлов …

Основная причина использования этой утилиты — когда вы подозреваете, что может возникнуть проблема с системным файлом Windows XP.

Возможно, вы получите диалоговое окно, сообщающее вам о проблеме с DLL-файлом или ваша программа просто не загружается! Поэтому стоит проверить, есть ли поврежденные системные файлы, используя scannow sfc.

Для этого просто перейдите в поле «Выполнить» в меню «Пуск» и введите:

sfc /scannow.

Эта команда немедленно инициирует службу защиты файлов Windows, чтобы проверять все защищенные файлы и проверять их целостность, заменяя любые файлы, с которыми она обнаруживает проблему.

В идеальном мире, который станет концом истории … Любые поврежденные, отсутствующие или неправильные файлы будут заменены этим процессом.

Как использовать Sfc /Scannow для восстановления Windows 7

  1. Первый шаг — открыть окно с повышенными командами. Для Windows 7 нажмите «Пуск» и введите cmd в поле «Поиск». Щелкните правой кнопкой мыши на cmd, чтобы получить раскрывающийся список. В списке нажмите «Запуск от имени администратора».
  2. Когда откроется окно командной строки, введите sfc /scannow и нажмите enter
    Процесс сканирования файлов поврежденных файлов занимает около 10-15 минут. Не закрывайте окно командной строки в течение этого времени.
  3. После того, как система выполнит 100% сканирование, могут быть два результата. В случае, если не обнаружено ошибок, появится сообщение: «Защита Windows не обнаружила нарушений целостности».
    В случае обнаружения ошибки система обнаружит ошибки и устранит их.

Также есть вероятность, что в окне появится сообщение о том, что Windows Resource Protection обнаружила поврежденные файлы, но не смогла исправить некоторые из них.

В таких случаях команда sfc /scannow требует дополнительной информации о местонахождении диска, на котором установлена ​​Windows 7.

Запуск сканирование SFC /SCANNOW помимо командной строки

При запуске sfc /scannow из-за пределов Windows, например, из командной строки, доступной при загрузке с установочного диска Windows или флеш-накопителя или с вашего диска восстановления системы или накопителя, вам нужно будет сообщить команду sfc точно, где Windows существует.

sfc /scannow /offbootdir=d: /offwindir=d:windows

Параметр /offbootdir = указывает букву диска, в то время как параметр / offwindir = указывает путь к Windows, снова включающий букву диска.

Примечание. В зависимости от того, как настроен ваш компьютер, командная строка при использовании извне Windows не всегда назначает буквы дисков так же, как вы видите их изнутри Windows. Другими словами, Windows может быть в C: Windows, когда вы ее используете, но D: Windows из командной строки в ASO или SRO.

В большинстве установок Windows 10, Windows 8 и Windows 7 C: обычно становится D: и в Windows Vista C: обычно остается C :. Чтобы убедиться в этом, найдите диск с папкой « Пользователи » на нем — это будет диск, на котором установлен Windows, если у вас нет нескольких установок Windows на нескольких дисках. Вы можете просматривать папки в командной строке с помощью команды dir .

The system file checker tool is a useful command used to scan and repair corrupt or damaged system files. This command is usually used when users encounter problems with the system files of Windows OS. sfc /scannow is the most popular command to…

The system file checker tool is a useful command used to scan and repair corrupt or damaged system files. This command is usually used when users encounter problems with the system files of Windows OS.

sfc /scannow is the most popular command to scan for corrupt system files immediately. It will not only scan, but also try to repair or replace corrupt system files with healthy ones. It requires a Windows installation source to copy files from.

The system file checker is a universal command and can be used in all Windows operating systems, including Windows 11, Windows 10, Windows 8, Windows 7 and Windows Vista.

This command line can perform several functions. We will discuss these in this article.

Table of contents

  • SFC Switches
  • Running Basic SFC Scan
  • Outputs of SFC Scan
  • Why SFC Scan Failed
  • How to Open SFC CBS.Log File
  • How to Fix SFC /ScanNow Failed

    • Scan Hard Drive
    • Enable Built-In Administrator Account
    • Reboot in Safe Mode
    • Log In From Built-In Administrator Account
    • Run DISM Utility
    • Run SFC ScanNow
  • Run Offline SFC ScanNow from WinPE
  • Manually Replace Corrupted Files
  • Scan Other Non-OS Volumes using SFC
  • How to Fix «Windows Resource Protection Could Not Start The Repair Service»

    • Start Dependency Service
    • Disable Turbo Memory
    • Modify Security Descriptors
    • Other Mitigation Methods
  • Frequently Asked Questions

    • Does SFC ScanNow fix anything?
    • How to run SFC scan?
    • Is the SFC scan safe?
    • What does SFC ScanNow actually do?
    • Can you exit SFC scannow?
    • Does SFC ScanNow improve performance?
    • Can SFC ScanNowfix BSoDs?

SFC Switches

The table below lists all the switches which can be used with the SFC command-line tool, and their functions:

Commands Function
sfc /scannow Scan for issues. If found, replace the file from the DLL cache.
sfc /scanonce Will scan only once.
sfc /scanboot Will scan the computer at every boot.
sfc /revert Revert the scanning functionality to its original (default) state.
sfc /purgecache Will remove the Windows File Protection cache and begin a scan over the system files.
sfc /cachesize=X Set the cache size of the Windows File Protection to X MBs.
sfc /? Display help regarding switches.
SFC switches and their function

Today, we are only going to be focusing on the “sfc /scannow” cmdlet as it is the one that quickly and effectively fixes your operating system.

Running Basic SFC Scan

The simplest (and most convenient) method to run the system file checker command is by running the following cmdlet in an elevated Command Prompt window:

sfc /scannow

sfc

Running basic SFC scan

The cmdlet will then perform its job and attempt to repair any protected files that may have been corrupted. However, that is not always the case, and users may encounter different errors from time to time.

Before we discuss these different errors, let us discuss the various outputs of the basic scan and what each of those means.

Outputs of SFC Scan

As you can observe in the image above, the output of the SFC scan states the following:

Windows Resource Protection found corrupted files and successfully repaired them.

It then also states the location of a CBS.log file which contains the details of the performed scan – we’ll get into that a moment later.

Let us now see all the possible outputs of the SFC scan that different users can encounter and what they mean:

Output Statement Meaning
Windows Resource Protection did not find any integrity violations. No missing or corrupted system files were detected, meaning your system’s integrity is intact.
Windows Resource Protection could not perform the requested operation. An unknown issue occurred and the scan could not be performed. In this case, you must adopt the alternative methods given below in this post.
Windows Resource Protection found corrupt files and successfully repaired them. Missing or corrupted files were found and have been repaired, restoring your system’s integrity.
Windows Resource Protection found corrupt files but was unable to fix some of them. Your system’s integrity was compromised, but SFC did not work. In this case, you must adopt alternative methods to fix the issue or replace the files manually using the given guide further down this post.
SFC outputs and their meanings

Apart from this, there are other possible issues that you may encounter while performing the scan.

Why SFC Scan Failed

You may encounter any one of the following scenarios while performing an SFC scan. The table below lists those scenarios along with their possible solutions.

Note: The methods to perform these solutions are discussed below.

Symptom of Failure Possible Solution
Scan stuck at verification Run the scan in safe mode or replace files manually
Scan gets frozen at a certain percentage First run the DISM tool and then run the SFC scan in safe mode.
Nothing happens when running “sfc /scannow” Run the DISM tool first and then run the SFC scan in safe mode.
SFC scan completely stops Disable Intel Turbo Memory and try rerunning the scan.
SFC scan cannot fix the problem First run the DISM tool and then run the SFC scan in safe mode.
Scan requires administrative privileges Run the scan from an administrator account with an elevated Command Prompt.
Reasons for SFC scan failure

Before we discuss the different methods to run the SFC scan, bypassing any issues, let us look at the log file generated when an SFC scan is executed.

How to Open SFC CBS.Log File

When you perform an SFC scan, the system automatically generates a log file named “CBS.log.” This file contains information on the scan that was executed, which can help you advanced troubleshoot if you encounter an issue with the SFC tool.

The CBS.Log file is saved at the following location:

C:WindowsLogsCBS

You can open this log file using a text editor, such as Notepad, Word, Wordpad, etc.

Follow these steps to open the file:

  1. Navigate to the following location using File Explorer:

    C:WindowsLogsCBS
  2. Here, right-click the file “CBS” then click Open with from the context menu.

    Select Open With from context menu

    Select Open With from context menu
  3. Now select the program you want to open the text file with from the popup and click Ok.

    Select program to open with

    Select program to open with

The log file will then open in the text editor.

CBS Log file

CBS.Log file

Since the CBS.Log file can be lengthy, you can analyze it using the Find function. You can look for keywords in the entire file using the CTRL + F shortcut keys, and then use the following keywords to look for the details on the file that may have been repaired, not repaired, corrupted, etc. Here is a list of the keywords you can use and the respective features you can find.

Keyword Details
Repaired View files that were repaired
Cannot repair View files SFC failed to repair – Will need to be replaced manually
Corrupt Files that are or were corrupted – Will need to be replaced manually
Keywords to analyze specific files

By analyzing the CBS.Log file, you can pinpoint the files which SFC could not repair, and then replace those files manually using the guide given down below.

How to Fix SFC /ScanNow Failed

If you are not able to fix your operating system using the basic approach for running the SFC scan, then there is still plenty you can do to mitigate the problem.

Note: The below methods need to be performed using only an administrative account and any commands need to be run using an elevated Command Prompt.

Note: The steps given below need to be performed in a methodical order as given.

  1. Scan Hard Drive

    To begin, you first need to scan your hard drive for errors or bad sectors using the Check Disk (CHKDSK) utility, since those could prevent the SFC scan from performing a successful repair. Here is how to do it:

    1. Open Command Prompt with administrative privileges.

    2. Run the following cmdlet:

      Chkdsk C: /f /r /x
    3. You will be asked to schedule the CHKDSK utility the next time the computer reboots. Enter Y for yes.

      chkdsk

      Run Check Disk utility
    4. Now restart your computer. Once it reboots, the Check Disk utility will run and scan your hard drive. This can take a while, in some cases, hours. Let the scan finish and reboot into Windows.

  2. Enable Built-In Administrator Account

    Now enable the built-in Administrator account, which will be needed by following the steps below. Using this account, you will have elevated privileges required to manipulate protected files.

    There are several ways to enable the built-in Administrator account on a Windows computer. Click here to learn more about them.

  3. Reboot in Safe Mode

    Safe Mode is a diagnostic mode that starts Windows in a basic state, loading a limited set of files and drivers. This is intended for troubleshooting Windows problems.

    Perform these steps to boot into Safe Mode with Networking – which means you will have access to the internet which is then later required to run the DISM utility.

    1. Open the System Configuration applet by typing in msconfig in the Run Command box.

      msconfig

      Open System Configuration applet
    2. Switch to the Boot tab. Here, in the Boot options section, check the box next to “Safe Boot,” and then select the Network radio button under it. Once done, click Apply and Ok.

      boot into safe

      Boot into safe mode with networking
    3. In the confirmation dialog box, click Restart.

      restart 3

      Confirm rebooting

    Your computer will now reboot into Safe Mode.

    Learn other methods to boot into Safe Mode.

  4. Log In From Built-In Administrator Account

    Now you must log in to the Administrator account that you enabled earlier. This will allow you to have the privileges to repair missing or corrupted system files.

  5. Run DISM Utility

    Once you are logged in, you must first run the DISM utility to fix the system image. Fixing the system image will then allow the SFC scan to perform its task without any hindrance.

    The DISM tool can be used to prepare, modify, and repair system images. However, you need an active internet connection to download and replace corrupted content from Windows Update, which is why we opted to boot into Safe Mode with internet connectivity.

    Follow these steps to run the DISM utility:

    1. Launch the Command Prompt with administrative privileges.

    2. Now execute the following cmdlets one after the other, allowing each cmdlet sufficient time to complete.

      DISM.exe /Online /Cleanup-image /Checkhealth
      DISM.exe /Online /Cleanup-image /Scanhealth
      DISM.exe /Online /Cleanup-image /Restorehealth

      dism cmd

      Run DISM utility

    Once this is done successfully, do not close the Command Prompt.

  6. Run SFC ScanNow

    Now all you need to do is run the basic SFC scan in an attempt to repair the operating system and the corrupted files within. Run the following cmdlet in an elevated Command Prompt:

    sfc /scannow

    SF scan in Safe Mode

    SFC scan in Safe Mode

That is it! This method should eliminate any issues you experience while performing the SFC scan in basic mode. Restart the computer once the scan is complete.

However, if you find the SFC utility is still unable to fix missing or corrupted files, there are still several things you can do. To begin, we suggest you analyze the CBS.Log file, as we discussed earlier in this post.

Run Offline SFC ScanNow from WinPE

The offline version of the SFC scan means that you run the scan from the Windows Preinstallation Environment (WinPE). This method can be especially useful if you are unable to boot into Windows.

This process requires a Windows installation device (DVD, bootable USB) that has the same OS version as installed.

Perform the following steps to attempt and repair any missing or corrupted system files using the SFC scan with WinPE.

  1. Plugin the bootable device and boot from it.

  2. On the first screen, click Next.

    Proceed to next

    Proceed to next
  3. Now click Repair your computer.

    Attempt to repair

    Attempt to repair
  4. Now select Troubleshoot.

    Select Troubleshoot

    Select Troubleshoot
  5. Now select Command Prompt.

    Open Command Prompt in WinPE

    Open Command Prompt in WinPE
  6. The Command Prompt will now open in front of you. Paste the following cmdlet to verify the drive letter assigned to the volume where Windows is installed.

    bcdedit

    Note down the drive letter beneath “Windows Boot Loader” in front of device.

    Note down drive letter

    Note down drive letter

    Note: Since the drive letters assigned in WinPE are not the same as the default drive letters you see when Windows is booted, these can be different for everyone. Therefore, it is important to determine which drive letter is currently assigned to the boot volume.

  7. Now use the following cmdlet to run the SFC scan here, while replacing DriveLetter (in 2 places) with the letter of the drive where Windows is installed as noted in the last step:

    sfc /scannow /offbootdir=DriveLetter: /offwindir=DriveLetter:Windows
  8. Once the scan is complete, restart your computer and boot normally into Windows.

If this does not work for you either, you can manually replace the corrupted files yourself.

Manually Replace Corrupted Files

At this point, you must have already analyzed the VBS.Log file we had discussed earlier. Using the file names determined from there, you can manually replace them with healthy files obtained from another computer. Here is how to do it:

  1. Start by taking ownership of the corrupted system file. To do so, run the following cmdlet in an elevated Command Prompt while replacing Path&FileName with the complete path and file name of the corrupted file:

    takeown /f Path&FileName

    Take ownsership of file

    Take ownership of file
  2. Next, grant the Administrators group full access to the file using the following cmdlet while replacing Path&FileName as earlier:

    icacls Path&FileName /GRANT ADMINISTRATORS:F

    Grant Administrators full rights to file

    Grant Administrators full rights to file
  3. Now you should be able to easily replace the file with another copy. At this point, copy the same file from a healthy computer having the same Windows version and paste it here, replacing the current one.

That is it! You can now repeat the same process to manually replace any corrupted files.

Scan Other Non-OS Volumes using SFC

It may be possible that you are running more than one operating system on your PC, and not all of them can be in the same drive (usually the C drive). In that case, you must direct the SFC scan to attempt and repair another drive.

Furthermore, you can also direct it to scan external drives, such as USB flash drives, SD cards, etc.

Here is how to do so:

Note: Since SFC can only fix missing and corrupted files, it can only attempt to repair drives with a Windows operating system in it.

  1. Open Command Prompt with elevated privileges.

  2. Now use the following cmdlet to scan another drive while replacing DriveLetter with the drive letter for the volume you want to scan:

    sfc/scannow/offbootdir=DriveLetter: /offwindir=DriveLetter:Windows

The scan will now attempt to repair any corrupted or missing files that you selected other than the C drive.

How to Fix “Windows Resource Protection Could Not Start The Repair Service”

It may be possible that you encounter the following error while trying to run an SFC scan on your computer:

Windows Resource Protection could not start the repair service

If so, here are a few things you can do to mitigate this issue:

Start Dependency Service

It may be possible that a dependency service named “Windows Modules Installer (Trusted Installer)” isn’t running on your computer, preventing the scan from happening. In that case, the service needs to be enabled.

  1. Open the Services console by typing in services.msc in the Run Command box.

    services

    Open Services console
  2. Here, scroll down and right-click on the service “Windows Modules Installer” and then click Properties from the context menu.

    Open service properties 1

    Open service properties
  3. From the popup, select “Startup Type” as Automatic, then click Start. When the service starts, click Apply and Ok to save the changes.

    Enable and start service 1

    Enable and start service
  4. Try rerunning the SFC scan.

Learn other methods to enable and disable Windows services.

Disable Turbo Memory

Intel Turbo Memory is a feature that allows NAND memory modules to power up, access programs, and write data on the hard drive much quicker than usual. This feature can be controlled through the system BIOS.

If you experience an SFC scan suddenly stops or cannot complete its job, then you must disable Turbo Memory from the BIOS settings.

Learn how to access BIOS.

Modify Security Descriptors

A Security Descriptor contains security information that may be associated with a securable object. It may be possible that critical Security Descriptors may have corrupted in the WinSXS folder where critical files are stored.

To mitigate this issue, perform the following task:

  1. Launch the Command Prompt with administrative rights.

  2. Now run the following cmdlet:

    ICACLS C:Windowswinsxs

    Modify Security Descriptor

    Modify Security Descriptors
  3. Now restart your computer and try rerunning the SFC scan.

Other Mitigation Methods

If you encounter the said error, there are other things you can also perform which we have already discussed above in this post. Here is a list of additional steps you can take:

  • Run Check Disk Utility.
  • Run DISM utility.
  • Run SFC scan in Safe Mode.
  • Replace corrupted files manually.

Frequently Asked Questions

Does SFC ScanNow fix anything?

Short answer: Yes, it does. However, the SFC tool itself can occasionally encounter errors, which are also fixable.

How to run SFC scan?

Run the following cmdlet in the Command Prompt:
sfc /scannow

Is the SFC scan safe?

Yes, the SFC scan is completely safe. In fact, you can even run it if nothing is wrong with your computer, just to ensure your device’s integrity.

What does SFC ScanNow actually do?

The SFC ScanNow cmdlet scans all protected files and replaces corrupted files with a cached copy that has been kept in its original shape.

Can you exit SFC scannow?

Yes, it is safe to cancel the scan. However, we do suggest that you allow it to be completed as it causes no harm. If you find that it is stuck you can cancel it using the CTRL + C keys simultaneously.

Does SFC ScanNow improve performance?

If the scan is able to fix critical files, it can sometimes improve the system’s overall performance and speed since the protected files are now as they should be.

Can SFC ScanNowfix BSoDs?

Potentially, yes. BSoDs are often caused by corrupted or missing files, and this is the one thing SFC is good at.

736

736 people found this article helpful

Updated on December 2, 2021

The sfc /scannow command is one of the several specific switches available in the sfc command, the Command Prompt utility invoking System File Checker.

While there are plenty of different things you can do with the command, sfc /scannow is the most common way that the sfc command is used.

Sfc /scannow will inspect all of the important Windows files on your computer, including Windows DLL files. If System File Checker finds a problem with any of these protected files, it will replace it.

Lifewire / Derek Abella

How to Use SFC /Scannow

  1. Open Command Prompt as an administrator, very often referred to as an «elevated» Command Prompt.

    For the sfc /scannow command to work properly, it must be executed from an elevated Command Prompt window in Windows 11, Windows 10, Windows 8, Windows 7 and Windows Vista.

  2. Type the following command and then press Enter.

    sfc /scannow
    

    To use System File Checker from the Command Prompt through Advanced Startup Options or System Recovery Options, see the Executing SFC /SCANNOW From Outside of Windows section below for some necessary changes in how you execute the command.

    System File Checker will now verify the integrity of every protected operating system file on your computer. It might take a while to finish.

    When the verification process completes, you’ll see something like this in the Command Prompt window, assuming problems were found and corrected:

    Windows Resource Protection found corrupt files and successfully repaired them. Details are included in the CBS.Log windirLogsCBSCBS.log. For example C:WindowsLogsCBSCBS.log. Note that logging is currently not supported in offline servicing scenarios.
    

    …or something like this, if no problems were found:

    Windows Resource Protection did not find any integrity violations.
    

    In some situations, most often in Windows XP and Windows 2000, you may also need access to your original Windows installation CD or DVD at some point during this process.

  3. Restart your computer if sfc /scannow repaired files. System File Checker may or may not prompt you to restart but even if it doesn’t, you should restart anyway.

  4. Repeat whatever process caused your original problem to see if sfc /scannow resolved it.

How to Interpret the CBS.log File

Every time you run System File Checker, a LOG file is created that itemizes every file that was checked and every repair operation that completed.

Assuming Windows is installed on the C: drive then the log file can be found here and opened with Notepad or some other text editor:

C:WindowsLogsCBSCBS.log

This file could be useful for advanced troubleshooting or as a resource for a tech support person that might be helping you out.

Executing SFC /SCANNOW From Outside of Windows

When running sfc /scannow from outside of Windows, like from the Command Prompt available when you boot from your Windows installation disc or flash drive, or from your System Repair Disc or Recovery Drive, you’ll have to tell the sfc command exactly where Windows exists.

Here’s an example:

sfc /scannow /offbootdir=d: /offwindir=d:windows

The /offbootdir= option specifies the drive letter, while the /offwindir= option specifies the Windows path, again including the drive letter.

Depending on how your computer is configured, the Command Prompt, when used from outside of Windows, doesn’t always assign drive letters in the same way that you see them from inside Windows. In other words, Windows might be at C:Windows when you’re using it, but D:Windows from the Command Prompt in ASO or SRO.

In most installations of Windows 11, Windows 10, Windows 8, and Windows 7, C: usually becomes D: and in Windows Vista, C: is usually still C:. To check for sure, look for the drive with the Users folder on it—that will be the drive Windows is installed on, unless you have multiple installations of Windows on multiple drives. Browse for folders in Command Prompt with the dir command.

Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

Subscribe

Понравилась статья? Поделить с друзьями:
  • Сканировать компьютер на ошибки
  • Сканировать диск на наличие ошибок windows 10
  • Сканировать видеокарту на ошибки
  • Сканирование файловой системы на ошибки
  • Сканирование текста на ошибки