View Full Version : "Switch OS" script?

3rd September 2006, 03:21 PM
When I ran Windows XP full-time, I got sick of Explorer, so I installed LiteStep. It had an icon on the desktop with a Windows logo and said "Switch to Explorer". Now, I run a dual-boot system with XP and Fedora.

That gave me an idea. So... is there a way to write a script that passes an argument to GRUB and then restarts my system? For example, I could have an icon on my Fedora desktop that says "Windows XP". Then I just click that and it runs a script which passes "Windows XP" to GRUB (the name of my XP entry) and then GRUB boots into Windows XP after my system has restarted.

Then I could do the same for Windows. Have an icon that says "Fedora Core 5" which boots into FC5.

I think it would be an interesting feature, even though I might not use it much. ;) At the moment, my Windows XP icon opens VMWare running my XP partition. :p

3rd September 2006, 03:24 PM
You could make a script that changes the option in grub for the default OS. So if you're in fedora you change the default to the windows entry and in windows to the fedora entry. And then the reboot command.

But I don't know if you can read the grub config file from windows.

3rd September 2006, 04:39 PM
I think I observed once that SUSE 10.1 had this option to reboot and go back immediately to SUSE... bypassing GRUB altogether. (I multi-boot between 4 OS).

Of course, I must be hallucinating, right? But SUSE isn't my default OS, and it takes ten minutes before GRUB boots my default OS if I don't press a key (I deliberately set it like that). It's been 2 months, I think. I'll see if I can find it in SUSE again. I'm pretty sure I wasn't just dreaming.

I'll see if I find it again and report back. If it does exist, then there is a way to restart the computer and make it boot what OS you want without having to go to the GRUB option screen. Seems pretty unlikely, I already doubt my own recollection of the event, honestly. But hey, no harm in looking.

3rd September 2006, 06:08 PM
grub nextboot - but is for linux, not windows

4th September 2006, 06:57 AM
Yep, that's what SUSE uses evidently.

4th September 2006, 07:02 AM
Yep, that's what SUSE uses evidently.
PCLinuxOS can do it too, even between different kernels.

4th September 2006, 07:09 AM
Well, looking at the link, it seems to be a KDE thing (not sure, but GNOME and others probably can replicate that behavior with ease, if they haven't already), so I guess even Kubuntu could have that if the developers bothered to include it (if they haven't already).