Link to home
Start Free TrialLog in
Avatar of thadkew

asked on

Finding GUID with BCDEdit

I need to find out how to use the for /f in conjunction with bcdedit to find out the guid.
I'm creating a bat file that can find the guid and then set the BCDEdit /bootsequence to the found GUID

It needs to look for the description as "Recovery" and then use the identifier as the guid.

so far i have:
for /F "tokens=2" %%A in ('bcdedit ^| find /I "description"' = "Recovery") do set MyGUID=%%A

echo %MyGUID%

bcdedit /bootsequence %MyGUID%

am I on the right track?
Avatar of TazDevil1674
Flag of United Kingdom of Great Britain and Northern Ireland image

for /F "tokens=2" %A in ('bcdedit /v ^| find /I "Recovery "') do set MyGUID=%%A

if you go to an elevated Command Prompt and type bcdedit /v you will see the standard output - you should be able to pick the right name for the GUID you need and ammend as necessary...
Avatar of oBdA

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thadkew


works great! thank you so much!