I'm fairly new to Linux and English is not my native language, so forgive me if I can't formulate my question correctly, but I'll try my best.
I have a Windows 10 laptop and decided to install Ubuntu on an USB Flash Drive. The installation created a folder named Ubuntu inside the EFI Partition on the HD.
In that folder there is a grub.cfg with the code
search.fs_uuid 69e684a2-b6e2-4701-9a56-5f83829026ed root hd3,msdos1
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
If the USB Flash Drive with Ubuntu is plugged, the Grub launches the Debian Menu with the option to boot from Ubuntu, Advanced Options, Windows, etc. If the USB Flash Drive is not present, the Grub enters command line.
I want to know if there is any code I can write that if the Grub doesn't detect the USB Flash Drive with Ubuntu installation, it automatically boots to Windows 10.
I understand that this line on the grub.cfg
search.fs_uuid 69e684a2-b6e2-4701-9a56-5f83829026ed root hd3,msdos1
Is for detecting the USB Flash Drive, so I wonder if I can do something like this (it is just an example):
If {USB Flash Drive = Detected}
<BOOT UBUNTU>
else
<BOOT WINDOWS 10>