Factory recovery - Create a Custom Recovery Partition  

Page 1 of 6 123 ... LastLast
    Factory recovery - Create a Custom Recovery Partition

    Factory recovery - Create a Custom Recovery Partition

    How to create a custom bootable recovery partition to restore Windows
    Published by Category: Installation & Upgrade
    24 Sep 2018
    Designer Media Ltd


    information   Information
    Most computers today with OEM pre-installed Windows come with a so called Factory recovery partition. This partition allows users to restore Windows 10 to it's original state, as it was when shipped from the factory.

    Although a practical feature, restoring Windows to its original state from manufacturer recovery partition means just that, restoring PC to its original state with all OEM bloatware and all possible trial software, Windows being not updated and so on.

    I prefer formatting OEM recovery partition and using that space to create my own instead. I setup a pre-installed Windows or clean install it, update fully, install software as I prefer and create user accounts, and before starting to use Windows I capture the Windows image to a custom install.wim file and use it in setting up my own custom "factory recovery" partition.

    When restoring Windows from this custom recovery partition, Windows is updated (as it was when image was captured), containing all pre-installed software, user accounts and user data, device drivers, custom settings like themes and so on.

    This tutorial will show how to create your own custom recovery partition. The method is easy and relatively fast.





    Factory recovery - Create a Custom Recovery Partition Contents Factory recovery - Create a Custom Recovery Partition
     Click links to jump to any part


    Part One: Capture Windows image
    Part Two: Prepare Recovery partition
    Part Three: Add Recovery partition to boot menu




    Factory recovery - Create a Custom Recovery Partition Part One Factory recovery - Create a Custom Recovery Partition
     Capture Windows image
    Note   Note
    Please notice: steps 1.1 through 1.3 are not required if your Windows 10 is already fully updated, all software is installed, user accounts created and Windows customized as you want to have it.

    1.1) Update Windows fully

    1.2) Create user accounts and install software you want to be included in Windows recovery image

    1.3) Customize Windows as you'd prefer, changing theme and other settings to your liking

    1.4) When done, boot computer from Windows install media, When the Windows Setup region and keyboard selection screen is shown, press SHIFT + F10 to open Command Prompt:
    Click image for larger version. 

Name:	Command Prompt at boot.jpg 
Views:	145 
Size:	110.4 KB 
ID:	194121

    1.5) Type DISKPART (#1 in next screenshot) and hit Enter to start the disk partitioning utility

    1.6) When booting from Windows install media, drive letters might be different from what they are when booting normally. Enter the command LIST VOL (#2) to check partition letters

    1.7) We need to capture the Windows partition and save that captured install.wim file on another partition (internal or external drive) or on a shared network folder. Check what temporary drive letter your Windows system partition has, in my case now it is D: drive (#3). In case you are saving the captured image to another partition on the same PC, check its drive letter, too. In this example case I could have chosen drive E: (#4) as the location to save the captured Windows image, but instead I will save captured image on a network share

    1.8) Enter command EXIT to quit DISKPART (#5)

    1.9) This step is optional, only required if you want to save captured image on a network share

    In this example now, I want to store the captured image on a shared network folder on another computer. To do that, I need first to initialize networking services with the command wpeinit (#6), then map the shared folder on that PC to a drive letter on the local computer.

    Path to a network share is told as \\server\share where server is the name of the computer where shared drive or folder is located, and share is the name that drive or folder is shared with. In my case I have shared a folder on computer AGM-W10PRO03, named the share as Storage, so the path is \\AGM-W10PRO03\Storage.

    For this example, I’ll map the shared network folder as drive Z: using the following command, entering network credentials (username and password to \\server) when prompted (#7):

    net use Z: \\agm-w10pro03\storage

    1.10) Now I can capture Windows to a custom WIM file with DISM. The switch /imagefile: followed by a path and filename tells the DISM command where to save the captured Windows image, in my case now I want to save image as install.wim on mapped network drive Z:. Switch /capturedir: followed by the drive letter, colon and backslash tells DISM which drive contains the Windows installation I want to capture, drive D: in this example case. Change these according to your needs.

    The command to capture image (#8):

    dism /capture-image /imagefile:Z:\install.wim /capturedir:D:\ /name:"Recovery" /compress:maximum
    Click image for larger version. 

Name:	Capture image.jpg 
Views:	291 
Size:	176.1 KB 
ID:	194123
    (Click to enlarge.)

    1.10) When done, close Command Prompt, close Windows Setup region selection window. Windows will restart, let computer boot normally to Windows





    Factory recovery - Create a Custom Recovery Partition Part Two Factory recovery - Create a Custom Recovery Partition
     Prepare Recovery partition

    2.1) Create a new partition on any internal HDD or SSD by shrinking an existing one (tutorial) or using unallocated space, name it as Recovery.

    Partition size (my recommendation) should be the size of your custom captured install.wim + 1 GB, rounded up to next full GB. For instance, if your custom install.wim is 6.2 GB, adding 1 GB makes 7.2 GB. Round it up to 8 GB (8,192 MB) for Recovery partition

    2.2) Mount Windows 10 ISO (same version & build as the captured Windows image) as virtual DVD drive (right click ISO image, select Mount). Copy its content to your new Recovery drive

    2.3) On your Recovery drive, browse to Sources folder and delete install.wim, or install.esd file in case your ISO was made using Windows Media Creation Tool. Replace the deleted WIM or ESD file by copying your custom install.wim to same folder





    Factory recovery - Create a Custom Recovery Partition Part Three Factory recovery - Create a Custom Recovery Partition
     Add Recovery partition to boot menu

    3.1) Copy following batch code, paste it to a new Notepad text file or any other text editor:

    Code:
    @ECHO OFF
    TITLE Add Recovery to Windows boot menu
    :SETLETTER
    CLS
    ECHO.
    ECHO             ###################################################
    ECHO             #                                                 #
    ECHO             #   This batch file creates recovery environment  #
    ECHO             #        adding it to Windows boot menu.          #
    ECHO             #                                                 #
    ECHO             ###################################################
    ECHO.
    SET /P DRIVELETTER= ^-- Please enter drive letter for your custom recovery partition (without colon): 
    IF NOT EXIST %DRIVELETTER%:\sources\boot.wim ECHO. & ECHO No valid Windows image found on given partition %DRIVELETTER% &ECHO. & PAUSE & GOTO :SETLETTER
    ECHO.
    bcdedit /create {ramdiskoptions} /d "Ramdisk"
    bcdedit /set {ramdiskoptions} ramdisksdidevice partition=%DRIVELETTER%:
    bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
    for /f "tokens=2 delims={}" %%i in ('bcdedit.exe /create /d "Recovery" /application OSLOADER') do (set guid={%%i})
    bcdedit /set %guid% device ramdisk=[%DRIVELETTER%:]\sources\boot.wim,{ramdiskoptions}
    bcdedit /set %guid% path \windows\system32\winload.efi
    bcdedit /set %guid% osdevice ramdisk=[%DRIVELETTER%:]\sources\boot.wim,{ramdiskoptions}
    bcdedit /set %guid% systemroot \windows
    bcdedit /set %guid% winpe yes
    bcdedit /set %guid% detecthal yes
    bcdedit /displayorder %guid% /addlast
    pause

    Alternatively, you can download the above batch file here: Recovery.bat

    Remember to unblock the downloaded batch file before using it (tutorial)!

    3.2) The batch file is for UEFI based machines with GPT partitioned HDD / SSD. If your PC is a BIOS based system with MBR formatted disk, change winload.efi in line 21 to winload.exe (highlighted blue in above batch sample)

    3.3) Save the file as a batch file with extension .bat, for instance as recovery.bat

    3.4) Open an elevated Command Prompt, run the batch giving full path. For instance, if you saved it as recovery.bat in Scripts folder on drive E:, enter following command:

    E:\Scripts\recovery.bat

    3.5) The batch file will be run, ask you the drive letter to Recovery partition you created, and set up the recovery environment adding it to boot menu
    Click image for larger version. 

Name:	Recovery Environment created.jpg 
Views:	120 
Size:	117.0 KB 
ID:	194321
    (Click to enlarge.)


    That's it! You have now Recovery option in boot menu. Selecting it, Windows Setup is run and you can clean install Windows 10, your custom image restoring it to the exact state it was when custom image was created. Everything will be there, from your custom desktop theme to user accounts and software already installed.
    Click image for larger version. 

Name:	Boot Menu.jpg 
Views:	112 
Size:	76.5 KB 
ID:	194135

    Tip   Tip
    If your system disk crashes and no boot menu is shown, you can do recovery from your custom recovery partition by booting from Windows install media and running Windows Setup manually from recovery partition.

    For instance, if your recovery partition has drive letter F:, start Command Prompt with SHIFT + F10 when Windows Setup shows the region selection screen, then enter following command:

    F:\Setup.exe

    Windows Setup will be run from your custom recovery partition.

    Happy recovery

    Kari
  1.    01 Jul 2018 #1

    Nice!
      My ComputerSystem Spec

  2. Kari's Avatar
    Posts : 15,138
    Windows 10 Pro
    Thread Starter
       01 Jul 2018 #2

    simrick said: View Post
    Nice!
    Thanks!

    This really is something I recommend to every user. Especially if you are running Insider builds, this is a fast and easy method to "save your behind" when something goes wrong and restore Windows to a working state.

    Kari
      My ComputerSystem Spec

  3.    01 Jul 2018 #3

    Kari said: View Post
    Thanks!

    This really is something I recommend to every user. Especially if you are running Insider builds, this is a fast and easy method to "save your behind" when something goes wrong and restore Windows to a working state.

    Kari
    Agreed!
      My ComputerSystem Spec

  4. Kari's Avatar
    Posts : 15,138
    Windows 10 Pro
    Thread Starter
       01 Jul 2018 #4

    I added this tip to the end of tutorial:

    Tip   Tip
    If your system disk crashes and no boot menu is shown, you can do recovery from your custom recovery partition by booting from Windows install media and running Windows Setup manually from recovery partition.

    For instance, if your recovery partition has drive letter F:, start Command Prompt with SHIFT + F10 when Windows Setup shows the region selection screen, then enter following command:

    F:\Setup.exe

    Windows Setup will be run from your custom recovery partition.

    Kari
      My ComputerSystem Spec

  5.    01 Jul 2018 #5

    Kari said: View Post
    I added this tip to the end of tutorial:

    Tip   Tip
    If your system disk crashes and no boot menu is shown, you can do recovery from your custom recovery partition by booting from Windows install media and running Windows Setup manually from recovery partition.

    For instance, if your recovery partition has drive letter F:, start Command Prompt with SHIFT + F10 when Windows Setup shows the region selection screen, then enter following command:

    F:\Setup.exe

    Windows Setup will be run from your custom recovery partition.

    Kari
    Oh thanks - that's important. Good to know.
      My ComputerSystem Spec

  6. SIW2's Avatar
    Posts : 513
    trying to install win10
       01 Jul 2018 #6

    I have been doing it for years in Win7.

    Also, if you run setup.exe on your recov partition from within your current windows, you should also be able to do a repair install.
      My ComputerSystem Spec

  7.    01 Jul 2018 #7

    SIW2 said: View Post
    I have been doing it for years in Win7.

    Also, if you run setup.exe on your recov partition from within your current windows, you should also be able to do a repair install.
    I would have to assign it a letter first right? Because normally the recovery partition is hidden. And the repair install would then include all my installed programs?
      My ComputerSystem Spec

  8. SIW2's Avatar
    Posts : 513
    trying to install win10
       01 Jul 2018 #8

    simrick said: View Post
    I would have to assign it a letter first right? Because normally the recovery partition is hidden. And the repair install would then include all my installed programs?
    Yep. Kari's batch file sets a drive letter.
      My ComputerSystem Spec

  9.    01 Jul 2018 #9

    Okay, good to know. But then I would have to make sure to keep it updated on a regular basis, (twice a year), because a repair install has to be at least the same version as you're running...or am I getting myself confused?
      My ComputerSystem Spec


 
Page 1 of 6 123 ... LastLast

Tutorial Categories

Factory recovery - Create a Custom Recovery Partition Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


Related Threads
Hello everyone. I have a fairly new Dell laptop that I installed a SSD in after cloning the original HDD. Somehow the factory recovery partition was not copied to the SSD. I have tried twice to upgrade to W-10 and each time it has failed with...
Hello everyone, I would like to ask. How can I restore Windows to Factory reset with all Acer apps and drivers like recovery management, etc. I have Acer Aspire E5 with Windows 10 and I tried (for the first time when I had Recovery Management)...
Custom Recovery Partition in Installation and Upgrade
Hello, I have a fresh intalled Win-10 NVMe P50 with all necessary drivers etc. All factory partitions were deleted before installing Win-10. Was wondering how to create a Recovery Partition that would work like Lenovo factory system does...
So how would the home user do this if they wanted to create a recovery after their Windows 10 upgrade. I know for Windows 8 you could do the recimg thing to create the image file. I tried doing the commands listed in one of the thread to create the...
Installation & Upgrade Create Custom Recovery Image in Windows 10 in Tutorials
How to Create a Custom Recovery Image used to Refresh Windows 10 This tutorial no longer works starting with Windows 10 build 10130 released on May 29th 2015. The "C:\Windows\System32\recimg.exe" file has been removed in build 10130, and will...

Tags for this Thread

Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:05.
Find Us