murphy78 DiskPart and Apply Image Script

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

  1. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    1,237
    911
    60
    #101 Chibi ANUBIS, Apr 27, 2016
    Last edited: Apr 27, 2016
    Yes yes I install my system with your script :)

    All work perfectly but if I integrate in All In One is not easy to choose the index because they are not displayed...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,213
    94,578
    450
    I use it in AiO's and it always works (with wim/swm/esd), did you use "exotic" characters in the index names?
     
  3. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    1,237
    911
    60
    No in English only
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,213
    94,578
    450
    I mean :"@$%^&*() and such.
     
  5. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    1,237
    911
    60
    No also :empathy3:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    1,237
    911
    60
    Any suggestion for fix it ? :weep:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Poseidon-30

    Poseidon-30 MDL Novice

    Oct 19, 2009
    6
    4
    0
    #107 Poseidon-30, May 27, 2016
    Last edited by a moderator: Apr 20, 2017
    Chibi ANUBIS you are French like me, so you need to change those parts

    Code:
    :SETUPCHECK
    ECHO Scanning !INSTALLIMAGE! to create the index list file. Please Wait...
    IF EXIST X:\IMAGELIST.TXT DEL /q /s X:\IMAGELIST.TXT
    for /f "tokens=2 delims=: " %%a in ('dism /Get-WimInfo /WimFile:!INSTALLIMAGE! ^| find /i "Index"') do (
    for /f "tokens=2 delims=:" %%g in ('dism /Get-WimInfo /WimFile:!INSTALLIMAGE! /Index:%%a ^| find /i "Nom"') do (ECHO %%a.%%g>>X:\IMAGELIST.TXT))
    Code:
    :APPLYIMAGE
    CLS
    for /f "tokens=2 delims=:" %%g in ('dism /Get-WimInfo /WimFile:!INSTALLIMAGE! /Index:!INDEX! ^| find /i "Nom"') do (set Nom=%%g)
    ECHO ===============================================================================
    ECHO.                              SETUP IS WORKING
    ECHO -------------------------------------------------------------------------------
    rem ECHO Script will now apply the !INSTALLIMAGE! Index !INDEX!.
    ECHO Script will now apply !Nom! Source: !INSTALLIMAGE! Index !INDEX!.
    ECHO This will take a while...
    ECHO -------------------------------------------------------------------------------
    Make the same for diskpart also 3 times:
    Code:
    ECHO LIST DISK | DISKPART | find /i "Disque !DISK!" >NUL
    
    Regards Fred
     
  8. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    1,237
    911
    60
    #108 Chibi ANUBIS, May 27, 2016
    Last edited by a moderator: Apr 20, 2017
    Thanks ! I go to test :clap:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    1,237
    911
    60
    #109 Chibi ANUBIS, May 28, 2016
    Last edited: May 28, 2016
    Thanks Poseidon-30 for your fix is work :hug2:

    And happy birthday Murphy78, sorry for the late ....
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    7,897
    10,733
    240
    yay, same here Happy birthday Murphy78 one great colaborator here trust me :yes::clap:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Poseidon-30

    Poseidon-30 MDL Novice

    Oct 19, 2009
    6
    4
    0
    Hello,

    Glad the fix works fine for you :tasty:


    For all others languages not UK-US, think to change those parts.


    Happy birthday Murphy78 :worthy:

    Regards Fred
     
  12. mehdibleu

    mehdibleu MDL Expert

    Jun 14, 2017
    1,009
    251
    60
    hello,

    i converted install.wim from AIO win7 iso to install.esd to reduce the size and i wanted to integrate the new converted install.esd into source folder win7 iso to create a new iso but it didn't work as apparently win7 does not support esd files so i put the install.esd file into win8.1 iso and created new iso and it worked like a charm, i was able to boot from the iso but the problem is that the language settings dialog of win8 appears when booting from the iso and i would like to disable it when booting from the iso so it will not appear anymore.

    so someone here "Enthousiast" suggested me to use this script to get rid of this language settings dialog of win8 but i was not able to get it work, everytime i run the 7script, it shows me an error as you can see here => https://img4.hostingpics.net/pics/297633Capture.png

    maybe i don't use it in the right way so if someone could help me usinf it correctly, that would be nice.

    Thank you.
     
  13. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,213
    94,578
    450
    Did you implement it in the 8.1 boot.wim index2, like described at the OP?
     
  14. mehdibleu

    mehdibleu MDL Expert

    Jun 14, 2017
    1,009
    251
    60
    #114 mehdibleu, Jul 3, 2017
    Last edited: Jul 3, 2017
    if you mean implement it by using this command line :
    dism /mount-wim /wimfile:c:\win10\sources\boot.wim /index:2 /mountdir:c:\mount (as described in the thread)
    i did it but it didn't work
    if it's not the right way to implement it so i don't know how to implement and i would need some help.
    could you please show me the part in the OP where it shows how to implement the script in the boot.wim index2 ?
     
  15. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,262
    1,731
    120
    If you want to mount boot.wim index 2, use this command.
    Code:
    dism /mount-image /ImageFile:C:\win10\sources\boot.wim /Index:2 /MountDir:c:\MOUNT
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. mehdibleu

    mehdibleu MDL Expert

    Jun 14, 2017
    1,009
    251
    60
    yes that's the command i used but i don't know if it's the right command that implements the script in the 8.1 boot.wim index2 to be able to get rid of this language settings dialog of win8 when booting from the iso as i want to do.
     
  17. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,213
    94,578
    450
    I might hope you know a bit of the basics about mounting wims etcetc?

    You have to adjust the commands, shown by Murphy78, to your own situation, like dhjohns showed.

    If you don't have the basic knowledge, you could use a DISM GUI tool, like this one: https://mikecel79.wordpress.com/category/dism-gui/

    The script isn't implemented by the mount command, after you've succesfully mounted the wim you have to follow the rest of the instructions.
     
  18. mehdibleu

    mehdibleu MDL Expert

    Jun 14, 2017
    1,009
    251
    60
    #118 mehdibleu, Jul 3, 2017
    Last edited: Jul 3, 2017
    if you talk about these instructions, i followed all of them correctly except the last one which i din't run as it only allows to create bootable iso.

    dism /mount-wim /wimfile:c:\win10\sources\boot.wim /index:2 /mountdir:c:\mount

    :Copy over the x64 folder's contents to the c:\mount\ directory
    :Do not copy over the entire x64 folder, just the contents.

    :**Make sure to add-package the winrecfg packages. I'll use an example directory here:
    dism /image:c:\mount /add-package /packagepath:c:\murphy78-DiskPart-Apply-v1.2.8\x64-winrecfg-packages\
    :that should add both the base package and the en-us package
    :you can add any other packages at this point such as a win10 cumulative

    dism /image:c:\mount /cleanup-image /startcomponentcleanup /resetbase
    dism /unmount-wim /mountdir:c:\mount /commit

    :export to new boot.wim to reduce size
    dism /export-image /sourceimagefile:c:Win10\sources\boot.wim /sourceindex:1 /destinationimagefile:c:\temp\boot.wim /checkintegrity
    dism /export-image /sourceimagefile:c:Win10\sources\boot.wim /sourceindex:2 /destinationimagefile:c:\temp\boot.wim /checkintegrity
    move /y c:\temp\boot.wim c:\win10\sources\

    :Make boot-prompt image with UEFI boot support (press any key blah blah)
    oscdimg -o -u2 -udfver102 -bootdata:2#p0,e,bc:\win10\boot\etfsboot.com#pEF,e,bc:\win10\efi\microsoft\boot\efisys.bin -lYourImageLabelMax32chars c:\win10\ c:\temp\YourISOName.iso
    That's it. I recommend testing it in a VM for a bit until you know what you're doing.

    Although, i was not able to run the command that allows to add winrecfg packages, maybe it's because of this command that it didn't work for me.
    when i tried to run the command, i got this error "The Specified Package is not applicable to this image"

    i would like to add that the win8.1 iso that i'm using is AIO ISO in french language.
     
  19. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,213
    94,578
    450
    The command does only work on 10240. You have to unpack the cabs and put the MUI file in "boot.wim\2\windows\system32\en-US" and the exe in "boot.wim\2\windows\system32". But winrecfg is only needed for when you want the recovery options to work (not supported on 7).

    The windows language doesn't matter, the script just runs in english and maybe some returns are shown in french (doesn't happen on my dutch projects).
     
  20. mehdibleu

    mehdibleu MDL Expert

    Jun 14, 2017
    1,009
    251
    60
    so what's the problem according to you ? why i don't manage to get rid of this language setting dialog of win8.1 when booting from the iso ? what am i missing to get it work ?