murphy78 DiskPart and Apply Image Script

Discussion in 'Scripting' started by murphy78, Apr 2, 2014.

  1. audison

    audison MDL Novice

    Dec 15, 2012
    39
    1
    0
    Enthousiast thanks for the reply. So what do I need for basic installation? It's "bios" only no uefi
    I am a bit lost in all different instructions over this thread...
     
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    21,420
    29,328
    390
    The instructions basically are:

    Copy the "windows" folder from the project folder to the mounted boot.wim index 2 and integrate the winrecfg packages (latter is not needed for the purpose you want it for).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. audison

    audison MDL Novice

    Dec 15, 2012
    39
    1
    0
    I think I did that successfully. I will try to add gpu drivers to the iso if it help somehow with booting but I am not hopeful. Laptop shuts down when the "loading/booting" from usb image is finished or so it looks like.
     
  4. 0xy89n

    0xy89n MDL Novice

    Aug 15, 2018
    11
    2
    0
  5. Bira

    Bira MDL Junior Member

    Oct 4, 2017
    53
    15
    0
    Hi s1ave77, how can I do to recognize the index, 1 or 1-100
    for /f "tokens=2 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" ^| findstr "Index"') do set VERSIONS=%%i

    and also all editions;
    for /f "tokens=2 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /index:1 ^| findstr /i Edition') do set Edition=%%i

    and make all index: 1 be for everyone or for example 1-2 or 2-3, can you help me?

    Thank you!!!
     
  6. s1ave77

    s1ave77 MDL Guide Dog/Dev

    Aug 15, 2012
    16,135
    24,377
    340
    Code:
    for /f "tokens=2 delims=: " %%A in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" ^| findstr "Index"') do (
         for /f "tokens=2 delims=: " %%a in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /index:%%A ^| findstr /i Edition') do set Edition=%%a
    )
    

    Code:
    for /d %%A in (2,3) do (
         for /f "tokens=2 delims=: " %%a in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /index:%%A ^| findstr /i Edition') do set Edition=%%a
    )
    

    Note: %%a and %%A are different runtimevariables and are used to not confuse the nested loop.
     
  7. Bira

    Bira MDL Junior Member

    Oct 4, 2017
    53
    15
    0

    Hello s1ave77 so below what I want to tell you the way you did not worked out right what I want to do, or of% VERSIONS% = %% i, it will be the index count;

    for all counts
    for /f "tokens=2 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" ^| findstr "Index"') do set VERSIONS=%%i

    For 1 index I got it recognized
    for /f "tokens=2 delims=: " %%a in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /Index:1 ^| findstr "Index"') do set VERSIONS=%%a

    and how do I recognize 1-3 or 1-5 for example in index without looping and pass already recognizing? what if he does it I'll know how to do 1-2-2-3 then understand?

    I already know of 1 index
    for /f "tokens=2 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /index:1 ^| findstr /i Edition') do set Edition=%%i

    in the editions I want to know how to recognize all without doing a loop, and also 1-3 or 3-5 as I said later I will know how to do the rest if I need 1-100


    So this is how my script works and it works perfectly in the editing there like this index: 1 the whole loop shows only the first, so I want every loop of the assemblies to recognize each edition% edition% I the quantity is 1-3 which I put it to assemble only the images I want not all understand? if you can help me

    ::================================================================================

    for /f "tokens=2 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /index:1 ^| findstr /i Edition') do set Edition=%%i
    for /f "tokens=2 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" ^| findstr "Index"') do set VERSIONS=%%i
    for /f "tokens=1" %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /index:1 ^| find /i "Default"') do set DEFAULTLANGUAGE=%%i
    for /f "tokens=2 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /index:1 ^| find /i "Architecture"') do set archwim=%%i
    if exist "%DVDDIR%\sources\install.wim" for /f "tokens=3 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /index:1 ^| find /i "ServicePack Build"') do set svcbuild=%%i
    for /f "tokens=2 delims=:" %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /Index:1 ^| find "ServicePack Level"') do set SPL=%%i
    for /f "tokens=2 delims=: " %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /Index:1 ^| findstr /i Version') do set Version=%%i
    for /f "tokens=2 delims=:" %%i in ('dism\dism.exe /english /get-wiminfo /wimfile:"%DVDDIR%\sources\install.wim" /Index:1 ^| findstr /i Installation') do set Installation=%%i
    )
    ::================================================================================

    for /L %%a in (1, 1, %VERSIONS%) do (
    if not exist %Mont% mkdir %Mont% >nul
    if not exist %Instal%\%%a mkdir %Instal%\%%a >nul
    if not exist %Tempdir% mkdir %Tempdir% >nul
    if not exist %Dismtempdir% mkdir %Dismtempdir% >nul
    echo ============================================================
    echo Montando Imagem - Index %%a-%VERSIONS%
    echo ============================================================
    echo.
    echo Edicao : %Edition%
    echo Versao : %Version%.%svcbuild%.%SPL%
    echo Quantidade : %%a-%VERSIONS%
    echo Idioma : %DEFAULTLANGUAGE%
    echo Arquitetura : %archwim%
    echo Instalacao :%Installation%
    echo.
    "%DISMRoot%" /ScratchDir:"%Dismtempdir%" /mount-wim /wimfile:"%DvdDir%\sources\install.wim" /index:%%a /mountdir:%Instal%\%%a
    echo.