Write a Program in Python/C++ To Test That Computer is Booted With Legacy Boot ROM-BIOS or UEFI.
============ Python Program ============
import os
print 'UEFI detected.' if os.path.exists('/sys/firmware/efi') else 'Legacy BIOS detected.'
============ OUTPUT ============
# Legacy BIOS detected.
============ C++ Program ============
include windows.h include iostream using namespace std; int main(){ GetFirmwareEnvironmentVariable("", "{00000000-0000-0000-0000-000000000000}", NULL, 0); if (GetLastError() == ERROR_INVALID_FUNCTION) { cout << endl << "Legacy BIOS detected."; } else{ cout << endl << "UEFI detected."; } cin.get(); return 0; }
============ OUTPUT ============
# Legacy BIOS detected.
=======================================================
** Note : Operating System Program.
Write a Program in Python/C++ To Test That Computer is Booted With Legacy Boot ROM-BIOS or UEFI.
Reviewed by Hardik Pandya
on
12:51:00 AM
Rating:
No comments: