Rename Wim Indexes

Discussion in 'Windows 11' started by Sansa1, Nov 15, 2023.

  1. Sansa1

    Sansa1 MDL Novice

    Oct 3, 2022
    23
    2
    0
    Is there a way or exists a script to rename all indexes of Windows instead of renaming one by one?
     
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,674
    103,514
    450
    Just repeat the (wimlib)imagex command for all indexes you want to rename.

    Example snippet from my AiO ISO creation script:
    Code:
    Bin\imagex /flags "Core" /info "AiO\x64\Sources\aio.install.wim" 1 "Win 11 (%BRANCHE%) Home x64 %LANG% (%BUILD%)" "Win 11 (%BRANCHE%) Home x64 %LANG% (%BUILD%)"
    Bin\imagex /flags "Core" /info "AiO\x64\Sources\aio.install.wim" 2 "Win 11 (%BRANCHE%) Home x64 %LANG% (%BUILD% - MRP)" "Win 11 (%BRANCHE%) Home x64 %LANG% (%BUILD% - MRP)"
    Bin\imagex /flags "Core" /info "AiO\x64\Sources\aio.install.wim" 3 "Win 11 (%BRANCHE%) Home x64 %LANG% (%BUILD% - MRP - HWID)" "Win 11 (%BRANCHE%) Home x64 %LANG% (%BUILD% - MRP - HWID)"
    Bin\imagex /flags "Core" /info "AiO\x64\Sources\aio.install.wim" 4 "Win 11 (%BRANCHE%) Home x64 %LANG% (%BUILD% - MRP - O365)" "Win 11 (%BRANCHE%) Home x64 %LANG% (%BUILD% - MRP - Office 365 - Ohook)"
    ............................
    Bin\imagex /flags "Professional" /info "AiO\x64\Sources\aio.install.wim" 9 "Win 11 (%BRANCHE%) Professional x64 %LANG% (%BUILD%)" "Win 11 (%BRANCHE%) Professional x64 %LANG% (%BUILD%)"
    Bin\imagex /flags "Professional" /info "AiO\x64\Sources\aio.install.wim" 10 "Win 11 (%BRANCHE%) Professional x64 %LANG% (%BUILD% - MRP)" "Win 11 (%BRANCHE%) Professional x64 %LANG% (%BUILD% - MRP)"
    Bin\imagex /flags "Professional" /info "AiO\x64\Sources\aio.install.wim" 11 "Win 11 (%BRANCHE%) Professional x64 %LANG% (%BUILD% - MRP - HWID)" "Win 11 (%BRANCHE%) Professional x64 %LANG% (%BUILD% - MRP - HWID)"
    Bin\imagex /flags "Professional" /info "AiO\x64\Sources\aio.install.wim" 12 "Win 11 (%BRANCHE%) Professional x64 %LANG% (%BUILD% - MRP - O365)" "Win 11 (%BRANCHE%) Professional x64 %LANG% (%BUILD% - MRP - Office 365 - Ohook)"
    .............................................
    Bin\imagex /flags "Enterprise" /info "AiO\x64\Sources\aio.install.wim" 25 "Win 11 (%BRANCHE%) Enterprise x64 %LANG% (%BUILD%)" "Win 11 (%BRANCHE%) Enterprise x64 %LANG% (%BUILD%)"
    Bin\imagex /flags "Enterprise" /info "AiO\x64\Sources\aio.install.wim" 26 "Win 11 (%BRANCHE%) Enterprise x64 %LANG% (%BUILD% - MRP)" "Win 11 (%BRANCHE%) Enterprise x64 %LANG% (%BUILD% - MRP)"
    Bin\imagex /flags "Enterprise" /info "AiO\x64\Sources\aio.install.wim" 27 "Win 11 (%BRANCHE%) Enterprise x64 %LANG% (%BUILD% - MRP - HWID)" "Win 11 (%BRANCHE%) Enterprise x64 %LANG% (%BUILD% - MRP - HWID)"
    Bin\imagex /flags "Enterprise" /info "AiO\x64\Sources\aio.install.wim" 28 "Win 11 (%BRANCHE%) Enterprise x64 %LANG% (%BUILD% - MRP - O365)" "Win 11 (%BRANCHE%) Enterprise x64 %LANG% (%BUILD% - MRP - Office 365 - Ohook)"
    
     
  3. Flipp3r

    Flipp3r MDL Guru

    Feb 11, 2009
    2,008
    957
    90
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,674
    103,514
    450
    Code:
    for /f "tokens=3 delims=: " %%i in ('Bin\wimlib-imagex info AiO\x64\Sources\install.wim ^| findstr /c:"Image Count"') do set images=%%i
    for /L %%i in (1,1,%images%) do (
      for /f "tokens=3 delims=<>" %%a in ('Bin\imagex /info AiO\x64\Sources\install.wim %%i ^| find /i "<HIGHPART>"') do set "HIGHPART=%%a"
      for /f "tokens=3 delims=<>" %%a in ('Bin\imagex /info AiO\x64\Sources\install.wim %%i ^| find /i "<LOWPART>"') do set "LOWPART=%%a"
      Bin\wimlib-imagex info AiO\x64\Sources\install.wim %%i --image-property CREATIONTIME/HIGHPART=!HIGHPART! --image-property CREATIONTIME/LOWPART=!LOWPART! >nul
    )
    Also a snippet from my AiO ISO creation tool:)