开发者

How do you programmatically detect dual booting (particularly Linux) from within Windows?

开发者 https://www.devze.com 2023-02-08 20:51 出处:网络
My dad is looking for ways to automate checking the settings of a Windows ser开发者_运维百科ver for giving it a standards compliance grade. He needs to know if more than one OS is installed, but wants

My dad is looking for ways to automate checking the settings of a Windows ser开发者_运维百科ver for giving it a standards compliance grade. He needs to know if more than one OS is installed, but wants to avoid taking down the server at all costs. Is there any technique within Windows (XP and newer) for programmatically ascertaining whether a machine has multiple OSs installed?


It depends on what you consider "an installed OS".

At the very least you'd have to scan all partitions (including the ones Windows's limited filesystem support can't recognize) for filesystems and then see if they "look" like another OS. If you need to know if the alternate OS is bootable as well, you'll have to scan for boot loaders and their configuration as well.

By the way, what difference does it make if there's another OS installed on the computer?


Not entirely reliably. You could attempt to access the MBR and the partition table and sniff for evidence of the competition if you can persuade Windows to let you open the other partitions as raw devices. It would be a heap of work.


How about doing a checksum of the bootloader and comparing it against a known-good list of Windows OS bootloaders on the HDs?

0

精彩评论

暂无评论...
验证码 换一张
取 消