I have a dual boot setup on my desktop machine, and currently Linux is the default OS, so unless I intervene during boot, it'll boot to Linux. I have a small script to reboot to windows if I'm logged in on Linux, by running sudo grub-reboot 2 && reboot
, and I'm wondering if I can do something similar from Windows. This will allow me to make Windows my default OS, without sacrificing the ability to easily switch to the secondary OS with a simple script.
I realise this may be impossible or inadvisable, as I know Windows has a habit of not cooperating in multi-boot situations, so feel free to point me at something that says it can't be done, or can't be done yet.
Summary: is there a script I can run from Windows, similar to grub reboot 2
on linux, that will change the boot priority for the next reboot only, to enable a quick switch to my secondary OS?
Addendum: use cases
I hope you'll excuse the repetition, I want to be thorough. All I'm lacking is the "Reboot to Linux" script.
Current situation
Linux is the default OS, and I have a script to swap to Windows.
- I am using Linux currently and want to switch to Windows. I run the script on my desktop labelled "Reboot to Windows". My computer restarts and Windows is selected. I do not intervene. It loads into Windows. Next time I reboot after this, Linux is still the default selection.
- I want to run Windows. I turn my computer on, and Linux is selected on the boot screen. I do not intervene in time, and it loads Linux. I run the script on my desktop labelled "Reboot to Windows". My computer restarts and Windows is selected. I do not intervene. It loads into Windows. Next time I reboot after this, Linux is still the default selection.
- I am using Windows currently and want to switch to Linux. I reboot my computer. My computer restarts and Linux is selected. I don't intervene. It loads into Linux.
- I want to run Linux. I turn my computer on, and Linux is selected on the boot screen. I don't intervene. It loads into Linux.
- I want to run Windows. I turn my computer on, and Linux is selected on the boot screen. I intervene and select Windows. It loads into Windows.
Preferred situation
Windows is the default OS, and I have a script to swap to Linux.
- I am using Windows currently and want to switch to Linux. I run the script on my desktop labelled "Reboot to Linux". My computer restarts and Linux is selected. I do not intervene. It loads into Linux. Next time I reboot after this, Windows is still the default selection.
- I want to run Linux. I turn my computer on, and Windows is selected on the boot screen. I do not intervene in time, and it loads Windows. I run the script on my desktop labelled "Reboot to Linux". My computer restarts and Linux is selected. I do not intervene. It loads into Linux. Next time I reboot after this, Windows is still the default selection.
- I am using Linux currently and want to switch to Windows. I reboot my computer. My computer restarts and Windows is selected. I don't intervene. It loads into Windows.
- I want to run Windows. I turn my computer on, and Windows is selected on the boot screen. I don't intervene. It loads into Windows.
- I want to run Linux. I turn my computer on, and Windows is selected on the boot screen. I intervene and select Linux. It loads into Linux.