bootsect.exe – is a command-line utility that is used to update the partition bootsector code and the master boot record code if desired.
Contents
Synopsis
Arguments enclosed with bracers { } are necessary, arguments enclosed with bracekts [ ] are optional, | stands for “or“.
bootsect.exe {/help | /nt52 | /nt60} {sys | all | <driveLetter:>} [/force] [/mbr]
Description
The bootsect.exe utility updates the partition bootsector code which is responsible for loading and running a bootloader. It can also update the master boot record code of the hard disk containing that partition without editing the partition table.
The options are as follows:
/help
Lists the existing arguments
/nt52
Updates the boot sector code of a targeted partition ( sys
, all
or <driveLetter:>
) with the code that loads and runs the NTLDR bootloader. Used on Windows XP and other versions on Windows that use the bootloader mentioned above.
/nt60
Updates the boot sector code of a targeted partition (sys
, all
or <driveLetter:>
) with the code that loads and runs the BOOTMGR bootloader. Used on Windows Vista and other versions on Windows that use the bootloader mentioned above.
/sys
Targets the partition used to boot the operating system and updates the boot sector code on it.
/all
Targets all partitions that can be used to boot an operating system and updates the bootsector code on them. It doesn’t work on the volumes that are dynamic i.e. not connected with a primary disk partition.
</driveLetter:>
Targets the volume associated with a specified drive letter and updates the bootsector code on it. It doesn’t update the boot sector code if volume with a specified letter doesn’t exist or if a volume with a specified letter isn’t connected to a primary disk partition.
/force
Updates the bootsector code on a targeted partition that would otherwise be inaccessible, e.g. the files on it are currently being used by other programs. Use it with caution because it can result in unexpected behaviors from these programs.
/mbr
Updates the master boot record code of the hard disk that contains a partition specified by the (sys
, all
or <driveLetter:>
). It doesn’t edit the partition table whatsoever. Before this command was introduced the only way to repair the MBR was trough the bootrec utility.
Exit Status
The bootsect utility exits 0 on success and 1 if an error occurs.
Examples
Update the boot sector code on a volume labeled D: that has Windows XP installed (NTLDR bootloader):
bootsect.exe /nt52 /D:
Update the boot sector code on a volume labeled C: that has Windows 7 installed (NTLDR bootloader):
bootsect.exe /nt60 /C:
Update the boot sector code on a volume labeled E: that has Windows 10 installed (NTLDR bootloader) and update the master boot record (MBR) code of the hard disk the volume E: belongs to:
bootsect.exe /nt60 E: /mbr
Compatibility
/nt52
Windows 2000, Windows 2003, Windows XP
/nt60
Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10
History
/mbr – This flag was introduced in Windows 7. The only way to fix the MBR before it was using the bootrec.exe utility.
See Also
bootrec – the utility that is uwsed to update the master boot record code, partition boot sectorcode and the boot configuration data.