Windows repair command prompt commands

How to Repair Windows 10 Using Command Prompt (5 Ways)?

When your computer won’t work properly, you can learn how to repair Windows 10 using command prompt from this article.

By AOMEI / Last Updated March 9, 2021

How do I repair Windows 10 with command prompt?

When there is some problem happens to Windows, you can repair your windows with some basic repair like Windows directory repair, boot directory repair. When the error is too serious, you can run advanced repair like system restore. For Windows 10, you can also use DISM command line utility to repair Windows 10 image. Next, this article will introduce you how to repair Windows 10 using command prompt with five methods.

Method 1. How to repair Windows 10 using SFC?

SFC (System File Checker) is a command-line utility that can scan for corruption in Windows system files and replace any corrupted or missing protected system files with a known good version. When you feel buggy with your computer or notice problems during boot, you can use SFC to diagnose problems and repair it.В

To repair Windows 10 using SFC with detailed steps:

1. Open «Start», search for the Command Prompt, select it and run as administrator.

2. Then type the command: «sfc /scannow» and press «Enter».

If SFC is unable to fix the problem, probably the utility cannot get the necessary files from the Windows image, which might have become broken. In this situation, you can use DISM to repair the Windows image.

Method 2. How to repair Windows 10 using DISM?

Windows 10 includes a command-line utility known as DISM (Deployment Image Servicing and Management). DISM command Windows 10 can be used to repair and prepare Windows images, including, Windows Setup, Windows Recovery Environment, and Windows PE. Also, DISM can be used to fix the recovery image within an installation of the operating system.

To repair Windows 10 using DISM commands:

To check whether there is any corruption, Run command line as administrator, then type the following syntaxВ and press «Enter».

DISM /Online /Cleanup-Image /CheckHealth

To scan the Windows image for any corruption, type below command and hit «Enter».

DISM /Online /Cleanup-Image /ScanHealth

To fix Windows image, type the following command and hit «Enter».

DISM /Online /Cleanup-Image /RestoreHealth /Source:repairSource\install.wim

Method 3. How to reset Windows 10 with command line?

To reset Windows 10 with «Reset this PC», follow the instructions below:

Type “systemreset -cleanpc” in an elevated command prompt and press «Enter».В (If your computer cannot boot, you can boot into recovery mode and select «Troubleshoot», and then choose «Reset this PC».)

Method 4. How to run system restore with command prompt?

If the problem is too severe, you can try to restore your Windows 10 to the previous state as long as you have enabled system restore. But, it willВ notВ restoreВ documents, music, emails, or personal files of any kind. If this is what you need, see below.

To run system restore in safe mode, follow the steps below:

1. Start your computer and press «F8» repeatedly until the Windows advanced options menu appears.

2. Click «Safe Mode with command prompt» and press «Enter». If your computer can boot normally, type «cmd» in the search box and click «Command Prompt» to continue.

3. Sign in using an administrator account if needed. Once the command prompt is showing, enterВ «rstrui.exe» at first in the Command Prompt Window andВ press «Enter» to continue.

4. This command will bring you to the interface of System Restore. You can either use the recommended restore point or click «Next» to choose an available restore point. Then, follow the instruction to complete system restore.

Method 5. How to repair Windows 10 with AOMEI.exe?

Besides system restore, you can also repair Windows 10 with AOMEI.exe. AOMEI Backupper is a reliable backup and restore software which is designed for Windows 10/8/7/XP/Visa. You can either backup and restore from graphic users interface or command line. It has some features that Windows built-in tool does not have. For example, you can use AOMEI Backupper to create incremental backup, and you can restore to a dissimilar hardware.

Читайте также:  Installing wget on linux

Suppose you have created system image backup with AOMEI Backupper. Before restoring system, you can use a utility named Check Image to check if system image backup is intact and without error.В

Then, use the following steps to restore windows 10 with AOMEI.exe:

1. Navigate to AOMEI Backupper installation directory by typing the following command in command line and press «Enter». For example: cd C:\Program Files (x86)\AOMEI Backupper.

Note: If you run this command under Windows PE environment, the drive letters might change.

2. Run the following command to start restore: AMBackup /r /t [backup type] /s «[backup location path]» /d [destination location]. For example: To restore the system backup saved in J:\systembackup1 to disk 1. You should type the command: AMBackup /r /t system /s “J:\system backup\systembackup1.adi” /d 1

Tip: If you need to restore to another computer, AOMEI Backupper «Universal Restore» feature can make this very easy. For example: Run system restore in the image named «systembackup1.adi» to the partition 0 on disk 0 and perform a universal restore. AMBackup /r /t system /s «D:\system backup\systembackup1.adi» /d 0:0 /x

Now you have learned how to repair Windows 10 using command line with five methods. You can choose one based on your preference. It is also suggested to keep backup software AOMEI Backupper installed on your computer to provide continuous protection (try 30-day free trial).В

Also, you can find «Recovery Environment» utility in «Tools» toВ enable the boot option of AOMEI Backupper recovery environment. When system crashes, it enables you to perform backup/restore from boot easily.

If you want to protect unlimited computers within your company, you can pick AOMEI Backupper Technician. With the inbuilt AOMEI Image Deploy tool, you are also allowed to deploy/restore system image file on server-side computer to multiple client-side computers over network.

Восстанавливаем Windows 7 с помощью «Командной строки»

Этапы восстановления Windows 7 через «Командную строку»

Причин, по которым «семёрка» может перестать запускаться, существует множество, но «Командную строку» следует задействовать в таких случаях:

  • Восстановление работоспособности жесткого диска;
  • Повреждение загрузочной записи (MBR);
  • Нарушение целостности системных файлов;
  • Сбои в системном реестре.

В остальных ситуациях (например, неполадками из-за вирусной активности) лучше воспользоваться более специализированным средством.

Разберём все случаи, от самого тяжелого до самого простого.

Способ 1: Восстановление работоспособности диска

Один из самых трудных вариантов ошибки запуска не только Windows 7, но и любой другой ОС – проблемы с жестким диском. Само собой, оптимальным решением будет немедленно заменить сбойный HDD, но свободный накопитель есть под рукой далеко не всегда. Частично восстановить винчестер можно с помощью «Командной строки», однако если система не запускается – придётся воспользоваться установочным DVD или флешкой. Дальнейшая инструкция предполагает, что таковые есть в распоряжении пользователя, но на всякий случай предоставляем ссылку на руководство по созданию установочного накопителя.

    Перед началом процедуры нужно соответствующим образом подготовить BIOS компьютера. Этим действиям посвящена отдельная статья на нашем сайте – приводим её, чтобы не повторяться.

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

Выберите предпочитаемые языковые настройки и жмите «Далее».

  • На данном этапе кликните по пункту «Восстановление запуска».

    Здесь несколько слов об особенностях распознавания жестких дисков средой восстановления. Дело в том, что среда иначе определяет логические разделы и физические тома HDD — диском C: в ней обозначен зарезервированный системный раздел, а непосредственно раздел с операционной системой по умолчанию будет D:. Для более точного определения нам и необходимо выбрать «Восстановление запуска», так как в нём обозначена буква нужного раздела.
  • После того, как вы узнали искомые данные, отменяйте средство восстановления запуска и возвращайтесь к главному окну среды, в которой на этот раз выберите опцию «Командная строка».

    Обратите внимание – если система установлена на диск D:, то в команде следует прописать chkdsk E: , если на E: — то chkdsk F:, и так далее. Флаг /f означает запуск поиска ошибок, флаг /r – поиск повреждённых секторов, а /x – размонтирование раздела для облегчения работы утилиты.

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

    Способ 2: Восстановление загрузочной записи

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

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

    Способ 3: Исправление повреждённых системных файлов

    Подавляющее большинство ситуаций, когда требуется восстановление системы, связаны с неполадками в системных файлах Виндовс. Причин сбоев существует масса: активность зловредного ПО, неаккуратные действия пользователя, некоторые сторонние программы и так далее. Но независимо от источника возникновения проблемы, решение будет одинаковое – утилита SFC, с которой проще всего взаимодействовать посредством «Командной строки». Ниже мы предоставляем вам ссылки на детальные инструкции по проверке системных файлов на целостность, а также восстановлению в почти любых условиях.

    Читайте также:  Linux meld что это

    Способ 4: Исправление проблем с системным реестром

    Последний вариант, при котором желательно задействовать «Командную строку» — наличие критических повреждений в реестре. Как правило, при подобных неполадках Виндовс запускается, но с работоспособностью возникают большие проблемы. К счастью, системные компоненты вроде «Командной строки» ошибкам не подвергаются, потому через неё можно привести установленную Windows 7 в рабочий вид. Этот способ подробно рассмотрен нашими авторами, поэтому обращайтесь к следующему руководству.

    Заключение

    Мы разобрали основные варианты сбоев в Виндовс седьмой версии, которые можно исправить использованием «Командной строки». Напоследок отметим, что существуют ещё частные случаи вроде неполадок с DLL-файлами или особо неприятными вирусами, однако создать подходящую для всех пользователей инструкцию не представляется возможным.

    Windows 7 Boot Repair via Command Prompt (5 Ways and 2 Tips included)

    Want to fix Windows 7 boot problems? You can see this article and learn Windows 7 boot repair via Command Prompt.

    By Ivy / Last Updated October 9, 2020

    If you have Windows 7 boot problems, the boot sector or master boot record on your system partition may be damaged, corrupted, or has missing files. And you will receive an error message like the following before Windows actually begins to load.

    Missing operating system

    Reboot and select proper boot device

    Invalid partition table

    Bootmgr is missing

    FATAL: No bootable medium found! System halted.

    Then, what are the boot sector and master boot record exactly?

    What are the boot sector and master boot record?

    The boot sector is a small section at the beginning of a hard drive. It’s created when you format the hard drive.

    The boot sector contains some code and data that helps BIOS hand off the startup process to Windows. It also hosts the Master Boot Record (MBR), which contains the disk signature, partition table for the disk, and a small bit of code called the master boot code.

    When a PC starts, the BIOS will load the master boot code into the PC’s RAM. Then it will scan the partition table, determine the active partition, load a copy of the boot sector into the PC’s RAM, and hand off the startup process.

    If you backup MBR in advance, you can use it to restore your computer and make it work as normal. If not, you can see the next part and learn to repair boot with command prompt in Windows 7.

    Five efficient ways to run Windows 7 boot repair

    Way 1: Startup Repair with Windows installation media

    If your boot sector or MBR runs into problems, you cannot start Windows normally. That’s to say, you need a bootable media to boot your computer. You can choose to create the Windows installation media or create a repair disk on a working computer.

    Start with the detailed steps:

    Step 1. Create Windows 7 installation media on a working computer. You can download ISO image files from Microsoft Store and burn the ISO image files to a USB drive or CD/DVD via Windows 7 USB DVD download tool.

    Step 2. Plug the USB drive into your computer.

    Step 3. Start your computer and press the corresponding key to go to BIOS.

    Step 4. Set boot priority to your drive in the Boot option.

    Step 5. Restart your computer and press any key to boot from it.

    Step 6. Wait for Windows 7 installation files to load.

    Step 7. Click Repair your computer in the initial Windows installation screen.

    Step 8. Select the operating system in the window and click Next.

    Step 9. Select Startup Repair in the System Recovery Options and it will automatically start to repair boot sector or MBR in Windows 7. Just wait patiently until the process is completed and click Finish.

    If the startup repair not working in Windows 7, you still can click View advanced options for system recovery and support in the last page and back to the System Recovery Options page. Then, try command prompt in Windows 7 to repair boot.

    Way 2: Windows 7 boot repair from Command Prompt

    Step 1. Click Command Prompt in the System Recovery options

    Step 2. Fix MBR in Windows 7. You can type the following command and hit Enter.

    bootrec /fixmbr

    Note: This command can write a new Windows-compatible MBR based on the version of your Windows to the boot sector. And it does not overwrite the existing partition table.

    Step 3. Repair boot sector in windows 7. You can type the command below and hit Enter.

    bootrec /fixboot

    Note: This command can write a new boot sector to the system partition. And it does not overwrite the current partition table. If you install multiple operating systems on this computer, you need to reconfigure the boot options.

    Step 4. Fix bootmgr is missing in windows 7 via command prompt. You can type the below command and press Enter.

    bootrec /scannos

    Step 5. Rebuild your BCD and get the missing Windows installations back. You can type the following command and press Enter to run it.

    bootrec /rebuildbcd

    Step 6. Rebuild the boot sector for Windows. You can type the following command and press Enter to start it.

    Читайте также:  У вас есть незавершенные процессы обновления windows 10

    bootsect.exe /nt60 all /force

    The /nt60 parameter applies the master boot code that is compatible with BOOTMGR. The /all argument updates the master boot code on all partitions.

    The /force parameter forcibly dismounts the volume(s) during the boot code update so that the Bootsect.exe tool does not gain exclusive volume access.

    Way 3: Repair boot sector in Windows 7

    If the bootrec /fixmbr and bootrec /fixboot doesn’t work, you can try to restore the boot sector code of your Windows 7 with steps below.

    Step 1. Go to Command Prompt in the System Recovery Options and then type the following commands to find the drive letter of your installation media. Just see “Type” column which contains the word “CD-ROM”.

    diskpart

    select disk 0

    list volume

    Step 2. Take D: as an example and type commands below. If not, you can replace it.

    d:

    cd boot

    dir

    step 3. Type bootsect /nt60 SYS /mbr and hit Enter to restore boot sector code.

    Step 4. Remove the installation media and restart your computer.

    Way 4: Rename and rebuild BCD via Command Prompt

    If the above command prompt does not work for you, you still can try to backup and rename BCD first and then rebuild it via CMD.

    Step 1. Select Command Prompt in the System Recovery Options and type bcdedit /export C:\BCD_Backup command to create a backup for BCD.

    Step 2. Type notepad in the command prompt and then click File > Open > Computer, find the file BCD in the corresponding drive, rename it as BCD.old, and then save the change and exit this window.

    Step 3. Type bootrec /rebuildbcd in the command prompt window and input Yes when prompt.

    Step 4. Type bcdedit /enum all in the window.

    Step 5. Type exit and reboot your computer.

    If you want to rebuild BCD without notepad, you can choose to type the following commands and hit Enter in order.

    bcdedit /export C:\BCD_Backup

    c:

    cd boot

    attrib bcd -s -h -r

    ren c:\boot\bcd bcd.old

    bootrec /RebuildBcd

    Note: cпјљrefers to the location of your Windows.

    Way 5: Windows 7 boot repair without disk

    Step 1. Turn on your computer, press and hold the F8 key to go to the Advanced Boot Options screen, then choose Safe Mode with Command Prompt.

    Step 2. You can try command prompt for Windows boot repair above and see if it works.

    Extra tips for Windows 7 boot repair

    1. Scan the integrity of your file system and hard drive and run Windows startup repair command prompt via chkdsk.

    Aside by problem of boot sector itself, the physical problem of your hard drive can also damage the boot sector and MBR. Thus, you need to rule out this possibility.

    2. Backup your computer with a free backup software.

    No one dares to say that you can recover your computer all the time. Once the recovery fails, you can only reinstall your computer and all the apps. What’s more, you will lose your files forever. Thus, you need to create a backup for your computer or files. With one or more backup in hand, you can restore it whatever happens. To backup your computer, you need a proper software. I recommend you the free backup software — AOMEI Backupper Standard.

    With this software, you can backup system, disk, partition, even a single file. You can use email notification to get to know whether your backup is completed successfully or not. Also, you can create a Windows 7 schedule backup at an interval date, such as daily, weekly, monthly.

    And you can manage backup disk space via Backup Scheme. But this feature is only available on the paid-version. If you want to free up disk space, you need to upgrade to AOMEI Backupper Professional. If you use server-based computer, you can directly download AOMEI Backupper Server edition.

    If you want to protect unlimited PCs and servers within your company, you may choose AOMEI Backupper Technician Plus. It offers unlimited billable technical services to clients. It also enables you to copy installation directory for portable version creation.

    To backup your computer, you can download the backup software and open it. Then, click Backup and select the Backup type in the list. At last, follow the corresponding article to finish the backup.

    To restore your backup, you can click Restore and complete the rest of step via on-screen instructions.

    If your computer cannot boot, you can create a bootable media on a working computer and boot the computer having trouble. Also, you can use PXE boot tool to boot the unbootable computer.

    Summary

    If you receive the above mentioned error message, the boor sector or MBR may be corrupted or damaged. You can use installation disk to run Startup Repair or do Windows 7 boot repair via Command Prompt.

    If you can repair boot with command prompt in Windows 7, you are very luck. But, sometime, you will fail to repair startup issue. To ensure the security of your data and your computer, you’d better to create a backup in advance. With a backup in hand, you can restore it at any time.

    Оцените статью