Universal way to temporarily reverse boot order with bcdedit.exe

0

Situation

I've got two boot-configurations. Let's say the UUID's are {1234} and {4321}.

Default is {1234}

What I want

When {1234} is booted, I want to switch the boot order from {1234} {4321} to {4321} {1234} but just for one boot. So I want to reverse boot order for the next time the computer boots up. The problem is that I don't know the UUID's. Because the "Script" that I'm trying to write has to work on multiple computers, where the UUID's obviously are going to differ.

What I tried

bcdedit.exe /bootsequence {current} /addlast

and

bcdedit.exe /bootsequence {default} /addlast

These commands did not work obviously. Another solution I could imagine is to query the UUID's. Is there a reliable way to get the UUID's and as well to check which one is booted? Or does anyone know a command for my specific needs?

Another way to ask the question:

Given two boot-configurations. When the default one is booted, I want to boot 'the other configuration' with the next restart (and only with the next restart). But I don't have the UUID of 'the other configuration'.

soumer

Posted 2016-04-13T14:49:36.570

Reputation: 121

Is there a reliable way to get the UUID's and as well to check which one is booted?: bcdedit /enum osloader /v and bcdedit /enum {current} /v? – Tom Yan – 2016-04-13T15:34:03.547

I use easy BCD for this, it is free, no need to register just hit the download button...http://neosmart.net/Download/Register

– Moab – 2016-04-13T16:54:14.393

@TomYan It has to be programmatically reliable. Sorry for not being clear about it. – soumer – 2016-04-14T06:50:27.407

@Moab Does it support the command line? Have not found anything about it on their website. I need to use is in a PowerShell script. – soumer – 2016-04-14T06:53:22.000

unfortunately it is gui only, sorry I could not help. – Moab – 2016-04-14T17:09:00.963

No answers