Home > Software engineering >  Is there a way to use a batch or command line under the small program to determine the system boot p
Is there a way to use a batch or command line under the small program to determine the system boot p

Time:12-25

is there a way to use a batch or command line under the small program to determine the system boot partition?
Sometimes the system boot partition is not necessarily a disk C, such as for VHD system, boot partition may be G: H: disk, may not drive, even if the current system is Windows 7, 8 to 10, including BIOS and UEFI environment, have good method to determine the system boot partition, and can automatically assigned drive letter? If you have any related commands the best Windows, such as wmic what of, if not, does anyone can write a small program to determine the system boot partition?
I consider question:
1, under the BIOS boot partition is active partition, traverse the active partition is no problem, the problem is likely to have multiple hard disks, every hard disk has active partition, activity partition may have bootmgr inside this file, it is difficult to distinguish, in addition to the problem of cross guide, guide files on the hard disk 0 lead on hard disk 1 system, the boot file on hard disk 1 guide system on the hard disk 0,
2, under the UEFI. May be the MBR/GPT disk partitions,
(1) for a GPT disk, generally speaking the ESP is partition boot partition, but does not rule out a GPT disk with multiple ESP partition, and even some hard disk does not need to ESP partition, motherboard native support for NTFS, are all the same start UEFI NTFS partitions,
(2) for MBR disk Boot partition may be FAT32 partition, don't even need to FAT32 partition, motherboard native support for NTFS, Boot partition may be an NTFS partition, there are multiple physical hard disk, multiple partitions are likely to exist H: \ EFI \ Microsoft \ Boot \ bootmgfw EFI such a file, is more complex,
Is there a good way to use the batch or command line small program to determine the "boot partition"? Have "off-the-shelf" small program or plan, don't need "repeat made wheels"? In this thanked first!
  • Related