Automatic switching between different installed Windows systems

2

I have currently 3 Windows systems installed on my machine (2x Win7, 1x Win8). To switch between them I have to restart my PC, choose right system in Windows Boot Manager and hit enter. Can I write script/program which will automatically restart PC and boot different Windows? I thought about changing default OS in bcdedit - is that right way?

michal3377

Posted 2017-07-27T14:16:03.663

Reputation: 123

Have you tried using msconfig to determine what you boot to? If you open the run menu and type msconfig you might find what you are looking for under the Boot tab. – Cheesus Crust – 2017-07-27T14:19:29.850

I know about msconfig, but as I said, I want to do it automatically. That means, I want to have for example 2 bat scripts, first will reboot me to other Win7 and second will reboot to Win8. – michal3377 – 2017-07-27T14:29:35.773

1Not an answer but might be useful. You should use virtualization where you can have access to the multiple OS at simultaneously. – Mukesh Jagani – 2017-07-27T15:48:47.980

I agree with exploring virtualization. There is little use for installing multiple operating systems independently and dealing with all the fuss. Virtual machines are far more flexible and perform just as well. – Appleoddity – 2017-07-28T03:39:38.440

I'm using VMs too, but I have more than one OS for another reason. I'm mainly using my Win8, where I have lots of software installed. My second OS is super-light Win7, optimized for gaming. I don't need to worry about situations like some program decides to update at anytime or many services running in background, eating my resources. Third OS is an old emergency Win7, which once saved my life when one of my HDD had broken. I'm not using it often and I know that I could have some Live CD OS for that purpose, but it takes only 30-40GB, so I just keep it. – michal3377 – 2017-07-28T12:42:59.293

Answers

0

You can create 3 BATCH scripts, one for each os, and they can use the bcdedit command to temporarily set the os to boot by using the /bootsequence {someguid} option.

How to do:

First we need to know the GUID of each os.For that execute bcdedit /v /enum ALL and look for a "Windows Boot Loader" entry with a description which matches the os you want to get the GUID from, now the GUID is the value in "identifier".
Now create for each os one batch script containing:

bcdedit /bootsequence {guid of os to start}
shutdown -r -t 0

Replace {guid of os to start} with the GUID you got before.
Now you can boot into every windows you want by executing the BATCH scripts as admin.

Tip:

You can create a desktop shortcut to execute the script as admin by default and use a keyboard shortcut.
For that create a shortcut of each script on your desktop, open it's properties, switch to the "Shortcut" tab, now you can set a key combination under "Shortcut key" and under "Advanced..." you need to check "Run as administrator".

Security Warning:

As you execute the scripts as admin you should set strict permissions to prohibit non-admin users from editing the scripts.

testeaxeax

Posted 2017-07-27T14:16:03.663

Reputation: 1 315

Thanks, that's exactly what I wanted. It's better solution than changing default OS. – michal3377 – 2017-07-27T19:23:56.393

0

You can use bcdedit /default {current} to set the currently running OS to default or bcdedit /default {GUID} to set a specific one to default.

Replace {GUID} with the identifier shown on the bcdedit command (with no parameters) for the boot loader you are interested in - for example

bcdedit /default {cbd971bf-b7b8-4885-951a-fa03044f5d71}

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/changing-the-default-boot-entry

lx07

Posted 2017-07-27T14:16:03.663

Reputation: 1 415