OEM Recovery Partition Creator for Windows

Discussion in 'MDL Projects and Applications' started by AnarethoS, Sep 11, 2010.

  1. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    You can't really change the size of the partition once everything is already done. Normally, you should "guess" the right size first and then set it Inside the settings file.

    Still, if you used the "Wim on the last partition" version, you can always copy the content of the whole partition somewhere else, delete it, extend your Windows partition to the good size and recreate the recovery partition and copy back the content there.

    Then, you will have to edit the "ResetPartitions.txt" file to match the right size.

    Finally, you will have to register the recovery image using REAGENTC. Since I am at my job right here (Windows 7), I don't have the exacp parameters to use it. Still, you can find them in the "Capture.cmd" file which is used to register the recovery image after capture.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. btdag

    btdag MDL Novice

    Apr 4, 2013
    35
    17
    0
    @AnarethoS - could you check my last post please - i think you missed it :)
     
  3. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    @AnarethoS
    Just wanted to drop a reply saying thank you. The newest alpha works great.
     
  5. patris971

    patris971 MDL Novice

    Dec 8, 2012
    27
    6
    0
    Hi AnarethoS

    I already wanted to thank and congratulate you for the work you have done during this time (BRAVO) ... So here, I tried the new version 1.3.16 in (W8 32bit) and (64bit W8) while is perfect, however, as (W7 32bit) and (W7 64bit) the creation of the DVD is not accomplished it ... tHAT is VMWare on laptop or pc the problem persists ... Did you have the same problem ?
     
  6. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    To help me diagnose the problem, I will have you to do some test.

    On a computer with the Tools installed/image created, go to : C:\Windows\System32\RecoveryTools\DVDMediaCreator

    Now, run each CMD script as an Administrator (right-click and select run as administrator)

    01-GetBootFiles.cmd
    - This file shoud create a folder named "RecoveryDVD" in the root of the C:\

    02-MountPartitions.cmd
    - This script should mount the recovery partition

    03-GetRecoveryFiles.cmd
    - This script should copy the recovery image and recovery environment
    - Check to see if you have C:\RecoveryDVD\TEMP\Disk1\Recovery\Install.swm file
    - Check to see if you have C:\RecoveryDVD\TEMP\Disk1\Recovery\winre.wim file

    04-UnMountPartitions.cmd
    - This script should unmount the recovery partition

    05-Copy Scripts.cmd
    - After running this script, you should have a file C:\RecoveryDVD\TEMP\DISK1\SOURCES\BOOT.WIM

    06-CreateDvd.cmd
    - This script should create the DVD file

    Check the output of each script to check if something seems to be wrong and give me the result.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. patris971

    patris971 MDL Novice

    Dec 8, 2012
    27
    6
    0
    For

    01-GetBootFiles.cmd ---> Ok

    02-MountPartitions.cmd ---> Ok

    03-GetRecoveryFiles.cmd ---> Error
    I had to type "F" to the question to continue the script...

    View attachment 25449

    04-UnMountPartitions.cmd ---> Ok

    05-Copy Scripts.cmd ---> Ok

    06-CreateDvd.cmd ---> Ok

    if it can help you solve my problem ...
    thank you very much
     
  8. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    #2428 AnarethoS, Nov 18, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    In the CMD file

    Replace that:
    Code:
    IF NOT EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install.swm XCOPY /SHK %RECOVERYLETTER%:\Recovery\WindowsRE\Install.WIM C:\RecoveryDVD\TEMP\DISK1\RECOVERY\Install.Wim
    
    With that:
    Code:
    IF NOT EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install.swm COPY %RECOVERYLETTER%:\Recovery\WindowsRE\Install.WIM C:\RecoveryDVD\TEMP\DISK1\RECOVERY\Install.Wim
    
    OR WITH THAT
    Code:
    IF NOT EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install.swm XCOPY /HK %RECOVERYLETTER%:\Recovery\WindowsRE\Install.WIM C:\RecoveryDVD\TEMP\DISK1\RECOVERY\
    
    And try again. Your situation was one that I didn't test (although I though that it may happen) where the recovery image is so small that it don't have to be splitted. XCOPY was aking if the file shoud be a file or directory. Using COPY should fix that.

    Edit : By the way, I saw you are using a French version of Windows. If needed, you can PM me in french also, since it is my natural language :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. patris971

    patris971 MDL Novice

    Dec 8, 2012
    27
    6
    0
    Hi AnarethoS

    It's ok problem solved:
    -the creation of the DVD under (W732 bits) and (W764 bits) ----> ok and thank you for the solution


    for:
    -restore from previously created under the iso (W732-bit) and (W764 bits) ----> restore stuck on "the creation of the recovery partition"
    View attachment 25472

    You could see where the error is Please ?

    Thank you in advance....
     
  10. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    I will check for your new problem.

    For the fix, which line of code did the trick to fix the problem?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. patris971

    patris971 MDL Novice

    Dec 8, 2012
    27
    6
    0
    sorry, I forgot to give it to you, this is the first solution :

    IF NOT EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install.swm COPY %RECOVERYLETTER%:\Recovery\WindowsRE\Install.WIM C:\RecoveryDVD\TEMP\DISK1\RECOVERY\Install.Wim
     
  12. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    #2432 AnarethoS, Nov 20, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I have the fix for you.

    Problem was similar to the one when creating the Recovery DVD. The problem was Under Windows 7 only and only when the image was small enough to fit on a single DVD.

    You will have to recreate the DVD to make the fix work.

    Replace the content of the following file
    Code:
    C:\Windows\System32\RecoveryTools\DVDMediaCreator\RecoveryScripts\Scripts\03-Rebuild Recovery Partition.cmd
    
    By this:
    Code:
    @Echo Off
    CLS
    
    ECHO ==============================================
    ECHO Loading Settings
    ECHO ==============================================
    FOR /F "delims=; tokens=1" %%I in (X:\Settings\SettingsRE.txt) DO SET %%I
    
    MD %RECOVERYLETTER%:\Recovery
    MD %RECOVERYLETTER%:\Recovery\WindowsRE
    MD %RECOVERYLETTER%:\FullRestore
    
    IF EXIST %WINDOWSLETTER%:\TempRecovery\Recovery\Install.swm X:\Scripts\IMAGEX%PROCESSOR_ARCHITECTURE%.EXE /REF %WINDOWSLETTER%:\TempRecovery\Recovery\*.SWM /Export %WINDOWSLETTER%:\TempRecovery\Recovery\Install.swm 1 %RECOVERYLETTER%:\Recovery\WindowsRE\Install.Wim "Windows"
    IF EXIST %WINDOWSLETTER%:\TempRecovery\Recovery\Install.Wim XCOPY /VHK %WINDOWSLETTER%:\TempRecovery\Recovery\Install.Wim %RECOVERYLETTER%:\Recovery\WindowsRE\
    
    COPY %WINDOWSLETTER%:\TempRecovery\Recovery\WinRE.WIM %RECOVERYLETTER%:\Recovery\WindowsRE\WinRE.WIM
    COPY %WINDOWSLETTER%:\TempRecovery\Recovery\Boot.sdi %RECOVERYLETTER%:\Recovery\WindowsRE\Boot.Sdi
    COPY %WINDOWSLETTER%:\TempRecovery\FullRestore\WinRE.WIM %RECOVERYLETTER%:\FullRestore\WinRE.WIM
    COPY %WINDOWSLETTER%:\TempRecovery\FullRestore\Boot.sdi %RECOVERYLETTER%:\FullRestore\Boot.Sdi
    
    ATTRIB -S -R -H %RECOVERYLETTER%:\*.* /S
    
    IF NOT EXIST %RECOVERYLETTER%:\Recovery\WindowsRE\Install.Wim EXIT 1
    IF NOT EXIST %RECOVERYLETTER%:\Recovery\WindowsRE\WinRE.Wim EXIT 1
    RD /S /Q %WINDOWSLETTER%:\TempRecovery
    EXIT 0
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    I have update the source of the 1.3.16 Alpha release to fix a problem Under Windows 7 when creating/restoring from DVD when the image was small enough to fit on only 1 DVD.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    The user @patris971 confirmed (by pm) that the new script for Windows 7 is working. Good!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    @ AnarethoS
    Is the03-Rebuild Recovery Partition.cmd file the only thing updated? Can I just copy and paste the above code and save it in the 03-Rebuild Recovery Partition.cmd file and be good or are there other changes. I already created two different f key functions and just wanting to avoid rebuilding it again. lol
     
  16. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    #2436 AnarethoS, Nov 20, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    The 2 files updated are the following one :
    Code:
    C:\Windows\System32\RecoveryTools\DVDMediaCreator\RecoveryScripts\Scripts\03-Rebuild Recovery Partition.cmd
    
    C:\Windows\System32\RecoveryTools\DVDMediaCreator\03-GetRecoveryFiles.cmd
    
    Nothing else has changed :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    Which one did you end up using or does it even matter?

    Update: Nevermind...I just downloaded 16 alpha again and extracted the files needed. Thanks again for all your hard work put into this. ;)
     
  18. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    #2438 AnarethoS, Nov 20, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Here are the 2 files that I modified recently fo r1.3.16 to fix the problem with Windows 7 and DVD recovery

    C:\Windows\System32\RecoveryTools\DVDMediaCreator\03-GetRecoveryFiles.cmd
    Code:
    @Echo Off
    %~d0
    CD "%~dp0"
    
    ECHO ==============================================
    ECHO Loading Settings
    ECHO ==============================================
    FOR /F "delims=; tokens=1" %%I in (.\Settings\SettingsRE.txt) DO SET %%I
    
    XCOPY /SEVHK %RECOVERYLETTER%:\Recovery\WindowsRE\WinRE.Wim C:\RecoveryDVD\TEMP\DISK1\RECOVERY\
    XCOPY /SEVHK %RECOVERYLETTER%:\Recovery\WindowsRE\Boot.Sdi C:\RecoveryDVD\TEMP\DISK1\RECOVERY\
    XCOPY /SEVHK %RECOVERYLETTER%:\FullRestore\WinRE.wim C:\RecoveryDVD\TEMP\DISK1\FULLRESTORE\
    XCOPY /SEVHK %RECOVERYLETTER%:\FullRestore\Boot.Sdi C:\RecoveryDVD\TEMP\DISK1\FULLRESTORE\
    ATTRIB -S -R -H C:\RecoveryDVD\TEMP\*.* /S
    
    "%CD%\Tools\Imagex%PROCESSOR_ARCHITECTURE%.EXE" /SPLIT %RECOVERYLETTER%:\Recovery\WindowsRE\Install.WIM C:\RecoveryDVD\TEMP\DISK1\RECOVERY\Install.SWM 3000
    IF NOT EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install.swm XCOPY /VHK %RECOVERYLETTER%:\Recovery\WindowsRE\Install.WIM C:\RecoveryDVD\TEMP\DISK1\RECOVERY\
    
    IF NOT EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install.swm IF NOT EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install.Wim EXIT 1
    IF EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install2.swm MOVE C:\RecoveryDVD\TEMP\DISK1\Recovery\Install2.swm C:\RecoveryDVD\TEMP\DISK2\Recovery\
    IF EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install3.swm MOVE C:\RecoveryDVD\TEMP\DISK1\Recovery\Install3.swm C:\RecoveryDVD\TEMP\DISK3\Recovery\
    IF EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install4.swm MOVE C:\RecoveryDVD\TEMP\DISK1\Recovery\Install4.swm C:\RecoveryDVD\TEMP\DISK4\Recovery\
    IF EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install5.swm MOVE C:\RecoveryDVD\TEMP\DISK1\Recovery\Install5.swm C:\RecoveryDVD\TEMP\DISK5\Recovery\
    IF EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install6.swm MOVE C:\RecoveryDVD\TEMP\DISK1\Recovery\Install6.swm C:\RecoveryDVD\TEMP\DISK6\Recovery\
    IF EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install7.swm MOVE C:\RecoveryDVD\TEMP\DISK1\Recovery\Install7.swm C:\RecoveryDVD\TEMP\DISK7\Recovery\
    IF EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install8.swm MOVE C:\RecoveryDVD\TEMP\DISK1\Recovery\Install8.swm C:\RecoveryDVD\TEMP\DISK8\Recovery\
    IF EXIST C:\RecoveryDVD\TEMP\DISK1\Recovery\Install9.swm MOVE C:\RecoveryDVD\TEMP\DISK1\Recovery\Install9.swm C:\RecoveryDVD\TEMP\DISK9\Recovery\
    EXIT 0
    
    C:\Windows\System32\RecoveryTools\DVDMediaCreator\RecoveryScripts\Scripts\03-Rebuild Recovery Partition.cmd
    Code:
    @Echo Off
    CLS
    
    ECHO ==============================================
    ECHO Loading Settings
    ECHO ==============================================
    FOR /F "delims=; tokens=1" %%I in (X:\Settings\SettingsRE.txt) DO SET %%I
    
    MD %RECOVERYLETTER%:\Recovery
    MD %RECOVERYLETTER%:\Recovery\WindowsRE
    MD %RECOVERYLETTER%:\FullRestore
    
    IF EXIST %WINDOWSLETTER%:\TempRecovery\Recovery\Install.swm X:\Scripts\IMAGEX%PROCESSOR_ARCHITECTURE%.EXE /REF %WINDOWSLETTER%:\TempRecovery\Recovery\*.SWM /Export %WINDOWSLETTER%:\TempRecovery\Recovery\Install.swm 1 %RECOVERYLETTER%:\Recovery\WindowsRE\Install.Wim "Windows"
    IF EXIST %WINDOWSLETTER%:\TempRecovery\Recovery\Install.Wim XCOPY /VHK %WINDOWSLETTER%:\TempRecovery\Recovery\Install.Wim %RECOVERYLETTER%:\Recovery\WindowsRE\
    
    COPY %WINDOWSLETTER%:\TempRecovery\Recovery\WinRE.WIM %RECOVERYLETTER%:\Recovery\WindowsRE\WinRE.WIM
    COPY %WINDOWSLETTER%:\TempRecovery\Recovery\Boot.sdi %RECOVERYLETTER%:\Recovery\WindowsRE\Boot.Sdi
    COPY %WINDOWSLETTER%:\TempRecovery\FullRestore\WinRE.WIM %RECOVERYLETTER%:\FullRestore\WinRE.WIM
    COPY %WINDOWSLETTER%:\TempRecovery\FullRestore\Boot.sdi %RECOVERYLETTER%:\FullRestore\Boot.Sdi
    
    ATTRIB -S -R -H %RECOVERYLETTER%:\*.* /S
    
    IF NOT EXIST %RECOVERYLETTER%:\Recovery\WindowsRE\Install.Wim EXIT 1
    IF NOT EXIST %RECOVERYLETTER%:\Recovery\WindowsRE\WinRE.Wim EXIT 1
    RD /S /Q %WINDOWSLETTER%:\TempRecovery
    EXIT 0
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. p0p0y23

    p0p0y23 MDL Novice

    Nov 20, 2013
    1
    0
    0
    detailed step by step procedure

    hi may i ask for a more detailed step by step procedure on how to apply your recovery tools? co'z ive try to follow your instructions on your documentations and i keep on getting errors during the update the settings. TIA
     
  20. AnarethoS

    AnarethoS MDL Expert

    Jul 31, 2009
    1,297
    1,587
    60
    - For Windows 7 : Copy Imagex.exe (32bits version) to "Imagex\32bits" and Imagex.exe (64bits version) to "Imagex\64bits)
    - For Windows 8 : Copy the "BOOT" and "EFI" folder from the DVD and copy them to the "Boot" folder
    - For Windows 8 : Copy the "BOOTMGR" and the "BOOTMGR.EFI" file from the DVD and copy them to the "Boot" folder
    - Copy all files from "Settings-Example\MBR" or "Setting-Example\GPT" folder to "Settings" folder and run the "update_settings.cmd" script.

    Run that from a writable source, like the computer HDD or flash drive.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...