murphy78 DiskPart and Apply Image Script

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

  1. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,964
    907
    60
    #21 Flipp3r, Apr 30, 2014
    Last edited by a moderator: Apr 20, 2017
    This is in my batch. Works fine:
    Code:
    ::========== Apply Image ================================================================================================
    dism /Apply-Image /ImageFile:%Wimfile% /Index:%Index% /ApplyDir:W:\
    IF %ERRORLEVEL% NEQ 0 goto Error3
    
    ::========== Setup Unattend.xml =========================================================================================
    md W:\Windows\Panther
    copy %PTH%Files\%Platform%-Unattend.xml W:\Windows\Panther\Unattend.xml /y
    
    ::========== Make Bootable ==============================================================================================
    W:\Windows\System32\bcdboot W:\Windows /l en-us /s S: /f UEFI
    IF %ERRORLEVEL% NEQ 0 goto Error4
    This was my original autounattend.xml. Any of the Windows setup/disk operations are passed. It just sets region & boots up in Audit Mode.
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    I didn't implement the unattend stuff yet, but I did a few minor changes and linked 1.2.2 on the OP
     
  3. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    Non-Boot-Wim Instructions seem to work fine for me.

    But if I try to do these steps:
    I get all the way to the (R)ecovery Partition Fast Setup portion of the script but then I get an error that no index's are found.
    The system cannot find the file specified.

    When I look through the command prompt I do find the install.wim file here:
    F:\sources\install.wim

    I am trying to do this with a Windows 8.1 with Update 1 x86 disk (BIOS Style).

    Thanks for everything you have done murphy78! :worthy: I hope you can help me.
     
  4. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,585
    340
    @murphy78

    If you want, then this thread can be moved here which seems more appropriate than Windows 8 section.
     
  5. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    Sure, that sounds good Tito. Could you help do that?
    Also upped v1.2.4 which fixes a couple small but critical fixes.
     
  6. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,585
    340
    Consider it done!

    :hug2:
     
  7. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    #27 Proph, May 14, 2014
    Last edited: May 14, 2014
    Can you please give a tutorial on how to get to the actual 7zip file without installing tons of spyware? I appreciate your work... but the way you are putting this file up for people to download is crazy. I have gone through the process of launching your downloader and unchecking as many boxes as I can (since I cannot see all of the boxes since it is so filled with checkboxes) and it still installs junkware onto my computer. But I do not get a file to extract anywhere.

    I have tried 3 times already.

    In the end it sends me to a page with a captcha... I input the text... hit enter and sit and wait while the page is supposed to load something... but it never does.

    WTF.jpg
     
  8. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,964
    907
    60
    I always use RGhost & have never had issue.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Not that hard to figure out if it offers an EXE named like *downloader*something.exe it's the Hosting Site that tries to screw you :doh:. Either uncheck the 'use our downloader' option or use the already mentioned rghost tipp :cool2:.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    hmmm... I tried searching on google for instructions on how to do this rghost but I don't know exactly what I'm looking for.

    I don't see an option in the exe to uncheck use our downloader.

    In the end the exe goes to an idownloader page with a captcha for the file... but the page isn't working.
     
  11. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,104
    24,378
    340
    Delete that EXE asap :cool2:. Recommend to use Malwarebytes to check for addware :g:.

    When you use the MirrorCreator link from OP, there is RGhost as one host, use this to download the propper archive.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    @murphy78 If you need a place for free hosting I can upload your files to mirror them for you. I am a hosting reseller so I have plenty of space available.
     
  13. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    Thanks for the help yall! I finally got it. The RGhost mirror worked.

    I did an ADWCleaner scan to cleanup my computer too.
     
  14. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    Thanks for this version. It has fixed the issue I was having. :)
     
  15. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    I have used this successfully with Windows 8.1 ISO's.... but on my Windows 7 SP1 ISO's it does not work.

    I get an error with choice.exe

    It says: it is not a valid Win32 application.

    Win32.jpg
     
  16. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    I grabbed the choice.exe and choice.exe.mui from my install.wim files for each x86 and x64 Windows 7 disks and replaced the files in your pack and now it is working. It seems the windows 8 versions of choice.exe do not work in windows 7.
     
  17. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    Hmmm... well when I added the Win7 choice.exe it gets further. But I am still having an issue. It gets all the way to "Saving Image" 1.0%

    Then it says:
    The Dism.log says something about there is not enough room on the disk.

    I was testing this in a VirtualBox environment. With a 50GB virtual drive 20GB Recovery Drive.

    Any ideas what might be the issue?
     
  18. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,964
    907
    60
    Use the latest ADK & build a WinPE v5.1. You can use this to install all editions.
    From your screen shot it looks like you've boot Win7, gone to the command prompt & run the script.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    The problem is most likely the running out of room. Are you sure you inputted 20000 for the recovery partition?
    If so, why? most wim files are only in the 2-4gb range.

    You might just use the winpe5.1 like flipp suggested. There's really no benefit to using the older winpe.
     
  20. Proph

    Proph MDL Junior Member

    May 2, 2007
    56
    64
    0
    I haven't tried the WinPE5.1 yet. That's next on my list. I like to learn the ins and outs of everything I use because I am a developer myself. ;) Plus I have some ideas on things I could also implement to your project as well to help out if you wouldn't mind. :)

    Yes you were right... I must have typed the size incorrectly. Toward the end after I make all of my selections I noticed that your script shows the index info and it shows that my Windows 8.1 Pro x86 install is almost 10 GB. Not sure why it is so much bigger... but it is a Windows 8.1 with Update 1 and I think I also integrated IE11 with the MSMG Toolkit. I don't think I integrated anything else but I guess it is possible. I know my install.wim file was about 4GB or more if I remember correctly... but I converted it to an install.esd file and now it is a little over 2 GB.

    So when I changed the restore image size to 10 GB it is now working. :)

    I would love to help enhance this project if you are willing to help me murphy78. I am very good with autoit and I could help make a gui for it. As well as implement a couple of programs I have created to it as well. I have been testing 2 backup programs I have created and they seem to work well during windows setup. One is called Gotcha Data Backup and the other is called DriverGrabber. They both work within a live Windows system as well as within WinPE. Gotcha backs up many of the important areas of the computer... like Microsoft Windows and Office Product keys, Documents, Favorites, WiFi Profiles, Mapped Drive Info, Office PSTs, Drivers and so on. DriverGrabber just backs up drivers.

    I think they could be implemented with your script very well. My thought is basically creating the recovery partition first with a drive letter... so that we can use Gotcha or DriverGrabber (or both) to make the initial backup into a folder. Then the user can create their system install partition with the space available. Once the recovery image is saved the Drivers that were backed up are moved into the recovery partition and the rest of the data backup can be moved into the $OEM$ section to be placed on the C: drive when the install is finished. Or something similar.

    I'm obviously no expert with diskpart so I would need your help on how we could code this all in a way that we could resize the partitions as needed and so on.

    What do you think of doing something like this? We could make a simple AiO tool for doing backup/reinstalls. :biggrin: