
tar file and unpack it, they're in the target folder. Max.USB size is 32GB.Create a USB and the LE install files are in the boot partition of the USB, or grab the update. create a row after every 16 // columns so that display // looks good if ( 0 = i % 16)įollowing is the display of the boot sector of a USB pendrive. file pointer begins at 0 // boot sector also starts at 0 // so read now. buffer to store the boot sector // only 512 bytes to be read if handle fails if (INVALID_HANDLE_VALUE = hUsb) use sprintf to construct // the path by appending // disk number to \\.\PhysicalDrive

open the disk now by using // the disk number // path format is \\.\PhysicalDriveN // so a buffer of 20 sufficient char diskPath = get the physicaldrive number // and the capacity of the disk if handle fails if (INVALID_HANDLE_VALUE = hVol) scanf used for readability // and simplicity only. for safety we restrict to // USB less than 32 GB so that // accidental access to hdd // can be avoided const int MAX_USB_GB = 32 PROGRAM TESTED ON // WINDOWS 10, 8 and 7 int main()
/how-to-boot-from-a-usb-device-2626091-D-v1-5b1183bd04d1cf00371e7aeb.png)
COMPILE WITH A WINDOWS COMPILER // SUCH AS VISUAL STUDIO C++ 2005 // OR LATER. You will most likely be interested in this article also: C++ Program to write to the boot sector of a USB Pendrive #include cpp file and compiled with a C++ compiler. COMPILE USING Visual Studio C++, Visual C++ Express, any edition, any version The Source Code Non-ASCII characters are printed as a dot.

It can work even with an old style floppy, CD and hard disks without any modification.

The program is not restricted to a USB drive.But you can change this limit as per need. For safety reasons, the pendrive must be less than 32GB.The program must be run with administrative access.
