Dual Boot Windows-Android on PC: How to switch OS programmatically?

1.6k Views Asked by At

In Windows, are there some command lines that would make the machine understand that Android should be the next boot (for one boot only -so once I reboot from Android I fall back into Windows)?

I am working on a notebook ASUS X200CA, UEFI-based machine, dualboot: Windows 8.1 and Android 7.1 (two different partitions). When Android is installed, I get Grub2, so at reboot I can manually choose between Windows or Android. However, I want to be able to switch OS programmatically.

Basically, I am looking for the equivalent of Linux - efibootmgr -n xxxx or grub-reboot x before using reboot - that I could implement on Windows.

I tried to use bcdedit /enum firmware to check the ID associated to Android then ran bcdedit /bootsequence {ID}. At reboot, this led to an error like:

File: \efi\Android\BOOTx64.EFI Status:0xc000000d Info: The application or operating system couldn't be loaded because a required file is missing or contains error

(NB: secure boot disabled, fastboot disabled)

  • I tried to use EasyBCD, but since this is an UEFI-based machine I didn't get very far.

  • I added Android to Windows Boot Loader using BOOTMGR, restarted, got to Windows Boot Loader, found the Android option, manually picked it and got the same error message (see above).

  • I tried Grub2win, you can modify the EFI boot order with it, but it seems that it's not for one boot only.

  • I know that some tablets dual boot Windows-Android have wintoand.exe that allows to switch but I am not sure what's behind. Moreover, I would prefer to not have to use any software: I want to know what command lines can achieve what I need.

If you have some ideas of how to solve this or anything to read that could guide me, Thanks for sharing in advance!

1

There are 1 best solutions below

0
On

I believe Grub2Win has the function you are looking for. Documentation will be found in the Grub2Win help under keyword Reboot.

The command format is:

C:\grub2\grub2win reboot x

where x is the menu selection number. This can be run from the Windows command line or a .bat file.

You will receive a message that the reboot has been scheduled.

If you wish to cancel a previously scheduled reboot, use this command:

C:\grub2\grub2win reboot none

Hope this helps.

Dave