Fix ‘sfc is not recognized as an internal command’ errors in Windows
If you’re trying to run Window’s System File Checker and keep seeing ‘sfc is not recognized as an internal command’ errors, you’re in good company. I see this one all the time in my other job as an IT Tech. There are a couple of ways to fix it and I’ll show you how to overcome the error for good.
System File Checker in Windows is an essential feature for maintaining a healthy system. It can scan Windows for file corruption and automatically repair any issues it finds. It is activated from the command line using ‘sfc /scannow’. It scans all of Windows, core files, Windows Store, apps, protected files and every element of the operating system. It is actually very good at what it does and is a tool I use all the time.
When you see a ‘xxx is not recognized as an internal command’, this is usually when the environmental variable within the settings have been changed or corrupted. In many situations, simply setting these variables back to defaults can fix the error and have you up and running again.
Fix SFC is not recognized as an internal command errors
There are two primary fix types for this error. One is very simple while the other requires you to dig into your Windows registry. If you follow the instructions exactly, no harm will come to you if you try either fix.
First, make sure you are using the command line as an administrator. SFC requires admin credentials and won’t work otherwise.
- Right click the Windows Start button and select Command Line (Admin).
- Type ‘sfc /scannow’ and hit Enter.
Hopefully this will work. If it doesn’t, you may need to delve deeper. Eventually you may need to modify two registry entries. Before you start, create a system restore point in Windows.
- Type ‘restore’ into the Windows Search box and create a restore point.
- Type ‘regedit’ into the Windows Search box and select File.
- Select Export and save the copy somewhere safe.
Now you have a system restore point should anything go wrong and a copy of your registry should you need it. If you follow the below instructions, you shouldn’t need either of these but it is much better to be prepared.
- Open CMD as an administrator.
- Type ‘cmd /d’ to stop autorun from running.
AutoRun is a Windows setting we may need to return to in a bit. For now, try this next procedure and see how you get on.
- Navigate to C:WindowsSystem32 and make sure CMD.exe is there.
- Navigate to Control Panel, System and Advanced system settings.
- Select Environmental Variables from the Advanced tab.
- Select Path in the System variables pane in the bottom pane.
- Select Edit.
- Copy ‘%SystemRoot%System32’ and ‘C:WindowsSystem32’ to Notepad.
- Change one of these entries in the Environmental Variable window to something else and select OK.
- Replace that value with the original from Notepad and select OK.
- Repeat for the other value.
Now retry the ‘sfc /scannow’ command in CMD. If the environmental value had been corrupted, you should now be able to use System File Checker as normal. If you don’t see the ‘SystemRoot%System32’ entry don’t worry. It’s a legacy setting that Windows uses to cover every eventuality. Newer Windows 10 computers don’t need it but it may be there anyway. If it isn’t in your options, you don’t need to add it. Just modify C:WindowsSystem32 on its own and see how it goes.
If you still see the SFC is not recognized as an internal command error, we need to perform the registry modification.
- Type ‘regedit’ into the Windows Search box and select Registry editor.
- Delete HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorAutoRun and HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorAutoRun
- Retest the SFC command.
I don’t actually know how or why this final method works, I just know that it does. It’s an old fix I have referenced in other TechJunkie tutorials and something I keep around in my Tech Toolkit for such eventualities.
System File Checker is a very important tool for troubleshooting Windows issues and I recommend you become familiar with it. If you do have problems running the command, one of the above fixes should have you up and running again in no time. I would definitely recommend fixing the problem as you never know when you may need it. It is better to have the tool ready for when you need it than not have it when you need it most.
Just don’t forget the obvious and always run the command line as an administrator!