Need bat file command with a dual boot sys using checkdsk

Page 2 of 2 FirstFirst 12

  1. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #11

    That's all well and good, but is there a way to do it via a Batch or Powershell script?

    I'm just looking for the knowledge.

    Hmmm, seems like bcdedit /default <ID> would do it, so if

    Code:
    C:\Users\ztruk>bcdedit /enum
    
    Windows Boot Manager
    --------------------
    identifier              {bootmgr}
    device                  partition=\Device\HarddiskVolume1
    path                    \EFI\Microsoft\Boot\bootmgfw.efi
    description             Windows Boot Manager
    locale                  en-US
    inherit                 {globalsettings}
    default                 {current}
    resumeobject            {8d90a8be-d39b-11ea-982c-97b4c3117002}
    displayorder            {current}
    toolsdisplayorder       {memdiag}
    timeout                 10
    
    Windows Boot Loader
    -------------------
    identifier              {current}
    device                  partition=C:
    path                    \WINDOWS\system32\winload.efi
    description             Windows 10
    locale                  en-US
    inherit                 {bootloadersettings}
    recoverysequence        {8d90a8c1-d39b-11ea-982c-97b4c3117002}
    displaymessageoverride  Recovery
    recoveryenabled         Yes
    isolatedcontext         Yes
    allowedinmemorysettings 0x15000075
    osdevice                partition=C:
    systemroot              \WINDOWS
    resumeobject            {8d90a8be-d39b-11ea-982c-97b4c3117002}
    nx                      OptIn
    bootmenupolicy          Standard
    hypervisorlaunchtype    Auto
    Then I could used bcdedit /derfault {bootmgr} or bcdedit /default {current} to switch between them from a batch file, right?
    By parsing the /enum output you could see which is currently Default and switch if that's what you want or you could accept a parameter to control who you switch to.

    Probably even easier in Powershell.
      My Computers


  2. Posts : 21,421
    19044.1586 - 21H2 Pro x64
       #12

    Ztruker said:
    That's all well and good, but is there a way to do it via a Batch or Powershell script?

    I'm just looking for the knowledge.
    ...........
    Probably even easier in Powershell.
    Got something to keep you busy honing your powershell skills
      My Computer


  3. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #13

    I keep trying ...
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:43.
Find Us




Windows 10 Forums