Dism script

Discussion in 'Windows 8' started by anybastard, Sep 24, 2013.

  1. anybastard

    anybastard MDL Novice

    May 9, 2007
    35
    0
    0
    Hello guys ,

    I hope that is the right forum section .

    My target is image a disk ( w8 ) with multiple partitions ( C - D - E ) using DISM tool .

    Now there is no problem to image a single partition one by one .

    My target is make a script that read the disk partions and make automatically the images of all partitions present into the disk

    Do you know if possible and or do you have some suggestion for me ? :rolleyes:

    Thanks in advance for your suggestion and / or help

    BRs
    AnyB.
     
  2. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    8,096
    27,017
    270
    #2 abbodi1406, Sep 24, 2013
    Last edited by a moderator: Apr 20, 2017
    1 wim:
    Code:
    @echo off
    DISM /Capture-Image /ImageFile:Custom.wim /CaptureDir:C:\ /Name:"Partition C" /Compress:max
    for %%A in (D E F G H I J K L M N O P Q R S T U V W X) do (if exist %%A:\Windows\DesktopTileResources\resources.pri DISM.exe /Append-Image /ImageFile:Custom.wim /CaptureDir:%%A:\ /Name:"Partition %%A")
    
    separate wim's:
    Code:
    @echo off
    for %%A in (C D E F G H I J K L M N O P Q R S T U V W X) do (if exist %%A:\Windows\DesktopTileResources\resources.pri DISM.exe /Capture-Image /ImageFile:Custom.wim /CaptureDir:%%A:\ /Name:"Partition %%A" /Compress:max)
    
     
  3. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,088
    60
    #3 Mr Jinje, Sep 24, 2013
    Last edited by a moderator: Apr 20, 2017
  4. anybastard

    anybastard MDL Novice

    May 9, 2007
    35
    0
    0
    Hi guys ,

    thanks a lot for your advices . I will try immediatly and if there is some problem I will disturb you again

    Brs
    AnyB
     
  5. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,544
    662
    60
    Are you doing this offline? If so, there's no guarantee the drive letters will be in the same order. Hidden partitions? System Partition? UEFI also has a msr partition which you can't back up...
     
  6. anybastard

    anybastard MDL Novice

    May 9, 2007
    35
    0
    0
    Yes, I'm doing this task offline , about the driver letter I will fix them by diskpart script and is the same for the other partitions that I cannot backup . About the hidden partition I think that is ok only assign a letter and this is possible by diskpart .

    Currently my focus is image several partitons ( same disk ) without user interaction . I'm checking Mr Jinje script but there is a problem when on the target unit is present an external HDD ( I'm using it to store the wim images ) because it is present on device ID list o_O

    BRs
    AnyB.