Command Prompt is a command line interpreter application available in most Windows operating systems. It’s used to execute entered commands. Most of those commands automate tasks via scripts and batch files, perform advanced administrative functions, and troubleshoot or solve certain kinds of Windows issues.
Command Prompt is officially called Windows Command Processor, but it’s also sometimes referred to as the command shell orcmd prompt, or even by its filename, cmd.exe.
Command Prompt is sometimes incorrectly referred to as “the DOS prompt” or as MS-DOS itself. Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS, but it’s not MS-DOS.
You can use system recovery tools to fix most of your computer problems. However, there are times when you’ll need to address such issues in a manual way, like, for example, when your Windows computer won’t boot. In these cases, you can use a tool named Bootrec.exe. It can help you troubleshoot and repair things like the master boot record (MBR), the boot sector or the Boot Configuration Data (BCD) store. Here’s how it works, in all modern versions of Windows:
The Windows System File Checker (SFC) is a nifty tool for repairing corrupted files. Here’s a quick guide on how you can restore your files and get your PC running normally again.
Run SFC
First, you will need to open an elevated Command Prompt (CMD). Basically, you will need to run Command Prompt as an administrator.
Open an Elevated Command Prompt
Run Search and type Command Prompt. Find Command Prompt from the results, right-click it, then select Run as Administrator.
Run DISM (Windows 8 and higher)
Windows 8, Windows 8.1, and Windows 10 users, you will need to run the Deployment Image Servicing and Management (DISM) tool before launching SFC.
Note: Windows 7 users can skip ahead to the next step.
In the Command Prompt, type the following command then press enter:
DISM.EXE /ONLINE /CLEANUP-IMAGE /RESTOREHEALTH
DISM will use Windows Update to find files that will replace or repair the corrupted versions. This process could take several minutes.
Run SCANNOW
Now we can scan the system for corrupted files. On the Command Prompt, type the command:
SFC /SCANNOW
With this command, Windows will go through your files and replace the corrupted files. Scanning will take some time. It’s important that you do not close the Command Prompt until the scan is 100% complete.
Review the Results
Once the scan is finished, you will receive one of the following messages:
- Windows Resource Protection did not find any integrity violations – Windows was unable to find corrupt files in your hard disk
- Windows Resource Protection could not perform the requested operation – This means you have to run System File Checker using Safe Mode
- Windows Resource Protection found corrupt files and successfully repaired them – Windows found the broken files and fixed them
- Windows Resource Protection found corrupt files but was unable to fix some of them — Windows found corrupt files but was unable to do anything about it
View SFC details
You can open the sfcdetails.txt file to view or copy the information gathered from the scan. Use the instructions below to locate the aforementioned text file.
Open an elevated Command Prompt and type the following command:
FINDSTR /C:"[SR]" %WINDIR%\LOGS\CBS\CBS.LOG >"%USERPROFILE%\DESKTOP\SFCDETAILS.TXT"
This will create a copy of the file on your desktop. Open the file and scan through the results. Do note that the file will show all the data, including ones that were gathered from previous SFC runs.
You will need to check the time and the date to find specific entries.
Replace Corrupt Files Manually
If SFC fails to replace the broken Windows file, you can try doing so manually. This is possible as long as you know where the corrupt file is located. You will also need a good copy of that file so it can be replaced.
Open an elevated Command Prompt and type the following command:
Remember to replace <File Location> with the path of the corrupt file. This command will allow you to take ownership of the infected file. CMD will inform you if the takeover is a success.
Once finished, give administrators access to the corrupt file. Do so by typing the following command:
Again, remember to replace <File Location> with the corrupt file path.
Now you can replace the bad file with the good version. You will need to copy the good file and paste it where the old one is. Type the following command:
Replace <Source> with the file location of the good copy and replace <Destination> with the path of the corrupt version.