{"id":3968,"date":"2016-05-13T04:23:50","date_gmt":"2016-05-13T09:23:50","guid":{"rendered":"http:\/\/neosmart.net\/wiki\/?page_id=3968"},"modified":"2016-05-26T05:18:03","modified_gmt":"2016-05-26T10:18:03","slug":"sfc","status":"publish","type":"page","link":"https:\/\/neosmart.net\/wiki\/winman\/sfc\/","title":{"rendered":"sfc.exe"},"content":{"rendered":"<p><strong>sfc.exe<\/strong> utility\u00a0scans the integrity of all system files protected by the\u00a0Windows File Protection (<strong>WFP<\/strong>) and has the ability to replace the incorrect versions with the correct Microsoft versions. To run the utility the\u00a0user must have administrator privileges.<\/p>\n<h2><span id=\"Synopsis\">Synopsis<\/span><\/h2>\n<p>Arguments enclosed with\u00a0bracekts <strong>[ \u00a0]<\/strong> are optional.<\/p>\n<pre><strong>sfc<\/strong> [\/<strong>scannow<\/strong>] [\/<strong>verifyonly<\/strong>] [\/<strong>scanfile=&lt;filePath&gt;<\/strong>] [\/<strong>verifyfile=&lt;filePath&gt;<\/strong>]\r\n    [\/<strong>offbootdir=&lt;bootDriveLetter&gt;<\/strong>] [\/<strong>offwindir=&lt;windowsDriveLetter&gt;<\/strong>] \r\n    [\/<strong>scanonce<\/strong>] [\/<strong>scanboot<\/strong>] [\/<strong>revert<\/strong>] [\/<strong>purgecache<\/strong>] [\/<strong>cachesize=x<\/strong>] \r\n\r\n<\/pre>\n<h2><span id=\"Description\">Description<\/span><\/h2>\n<p>The <strong>sfc<\/strong>\u00a0utility has a number of flags with the <code><strong>\/scannow<\/strong><\/code>\u00a0being the most used one. The utility can be run on all Windows machines as well as from Windows recovery console, though not all flags and options are supported on all operating systems. Refer to the &#8220;Compatibility&#8221; section below for a synopsis of platform-supported flags.<\/p>\n<p>The options are as follows:<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><code><strong>\/?<\/strong><\/code><br \/>\nLists the existing\u00a0flags<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><code><strong>\/scannow<\/strong><\/code><br \/>\nScans the integrity of all protected system files and repairs\u00a0the files that are corrupt or modified right after executing the command. Those files are restored to their default values.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><strong><code>\/verifyonly<\/code><\/strong><br \/>\nScans the integrity of all protected system files\u00a0right after executing the command but doesn&#8217;t repair them.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><strong><code>\/scanfile=&lt;filePath&gt;<\/code><\/strong><br \/>\nScans the integrity of a file specified by it&#8217;s absolute path (<strong>filePath<\/strong>) and repairs it if modifications\u00a0are identified. An example\u00a0<strong>filePath<\/strong> is <code>c:\\windows\\system32\\example.dll<\/code><\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><strong><code>\/verifyfile<\/code><\/strong><strong>=&lt;filePath&gt;<\/strong><br \/>\nScans the integrity of a file specified by it&#8217;s absolute path (<strong>FilePath<\/strong>) but doesn&#8217;t repair it. An example <strong>filePath\u00a0<\/strong>is c:\\windows\\system32\\example.dll<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><strong><code>\/offwindir=&lt;windowsDriveLetter&gt;<\/code><\/strong><br \/>\nUsed with <code><strong>\/offbootdir<\/strong><\/code> to specify\u00a0the drive on which the Windows is installed so it&#8217;s system files can be updated.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><strong><code>\/offbootdir=&lt;bootDriveLetter&gt;<\/code><\/strong><br \/>\nThe <code><strong>\/offbootdir=&lt;bootDriveLetter&gt;<\/strong><\/code> specifies the letter associated with the drive that needs to be repaired. It&#8217;s used with <code><strong>\/offwindir=&lt;windowsDriveLetter&gt;<\/strong><\/code>. Here is an example of how these two commands are used in the Windows Recovery Console.<br \/>\n<code>sfc \/scannow \/offbootdir=d:\\ \/offwindir=d:\\windows<\/code><br \/>\nIt scans and repairs the files specified by the <code><strong>offwindir<\/strong><\/code> flag using the original Microsoft files found on <code><strong>offbootdir<\/strong><\/code> path.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><strong><code>\/scanonce<\/code><\/strong><br \/>\nScans and repairs the protected files next time Windows boots.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><code><strong>\/scanboot<\/strong><\/code><br \/>\nScans and repairs the protected files every time\u00a0Windows boots.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><code><strong>\/revert<\/strong><\/code><br \/>\nThis command is used to cancel preciously executed commands. For example if the user executed the <code><strong>\/scanboot<\/strong><\/code> command, which runs the scan every time Windows boots, running the <code><strong>\/revert<\/strong><\/code> command will turn turn it off.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><code><strong>\/purgecache<\/strong><\/code><br \/>\nDeletes the files from Windows cache folder where it stores the original system files once they get modified. User must use this command with caution because it can lead to system failures. The command also runs the scan and fills the cache folder with copies of current system files.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\"><code><strong>\/cachesize=x<\/strong><\/code><br \/>\nChanges the cache size to fulfill the user&#8217;s needs. The <strong>x\u00a0<\/strong>parameter is specified as a number of megabytes.<\/p>\n<h2><span id=\"Exit_Status\">Exit Status<\/span><\/h2>\n<p><strong>sfc.exe<\/strong> returns\u00a0<strong>0<\/strong> on success and <strong>1<\/strong> if an error occurs.<\/p>\n<h2><span id=\"Examples\">Examples<\/span><\/h2>\n<p>To immediatly scan and restore damaged system files:<\/p>\n<p><strong><code>sfc \/scannow<\/code><\/strong><\/p>\n<p>To scan the integrity of an example file without repairing it:<\/p>\n<p><strong><code>sfc \/verifyfile=c:\\windows\\system32\\example.dll<\/code><\/strong><\/p>\n<p>To scan and repair an example file from the Windows Recovery Console with Windows instalation cd in the drive f:<\/p>\n<p><strong><code>sfc \/scanfile=d:\\windows\\system32\\example.dll \/offbootdir=f:\\ \/offwindir=d:\\windows<\/code><\/strong><\/p>\n<h2><span id=\"Compatibility\">Compatibility<\/span><\/h2>\n<p style=\"margin-left: .5in;text-indent: -.5in\">sfc.exe utility works on Windows Vista and later versions of Windows.<\/p>\n<p style=\"margin-left: .5in;text-indent: -.5in\">\n<p style=\"margin-left: .5in;text-indent: -.5in\">\n<h2><span id=\"History\">History<\/span><\/h2>\n<p><code>Verifyonly<\/code>, <code>scanfile<\/code>, <code>verifyfile<\/code>, <code>offbootdir<\/code> and <code>offwindir<\/code> flags were introduced in Windows Vista.<\/p>\n<h2><span id=\"See_Also\">See Also<\/span><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>sfc.exe utility\u00a0scans the integrity of all system files protected by the\u00a0Windows File Protection (WFP) and has the ability to replace the incorrect versions with the correct Microsoft versions. To run the utility the\u00a0user must have administrator privileges. Synopsis Arguments enclosed with\u00a0bracekts [ \u00a0] are optional. sfc [\/scannow] [\/verifyonly] [\/scanfile=&lt;filePath&gt;] [\/verifyfile=&lt;filePath&gt;] [\/offbootdir=&lt;bootDriveLetter&gt;] [\/offwindir=&lt;windowsDriveLetter&gt;] [\/scanonce] [\/scanboot] [\/revert] [&hellip;]<\/p>\n","protected":false},"author":516,"featured_media":0,"parent":3793,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3968","page","type-page","status-publish","hentry"],"aioseo_notices":[],"jetpack_shortlink":"https:\/\/wp.me\/P3SlTq-120","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/pages\/3968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/users\/516"}],"replies":[{"embeddable":true,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/comments?post=3968"}],"version-history":[{"count":64,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/pages\/3968\/revisions"}],"predecessor-version":[{"id":4252,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/pages\/3968\/revisions\/4252"}],"up":[{"embeddable":true,"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/pages\/3793"}],"wp:attachment":[{"href":"https:\/\/neosmart.net\/wiki\/wp-json\/wp\/v2\/media?parent=3968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}