How to create a Recovery partition to customize Windows recovery
Most computers today with OEM pre-installed Windows have Factory Recovery partitions. This partition allows users to restore Windows 10 to their original state as transferred from the factory.
Although a practical feature, restoring Windows to its original state from the manufacturer's Recovery partition means restoring the computer to its original state with all OEM bloatware and trial software, Windows. updated, etc.
This article will guide you to restore Windows to its original state by formatting the Recovery OEM partition and using that space to create your own partition. Then set up or install from the beginning of Windows, fully update, install the software, create user accounts and before starting to use Windows, get the Windows image to create the install.wim file. Use this file to set up a custom Recovery partition.
- How to backup and restore Windows 10 from System Image
- Complete how to use all backup and restore tools on Windows 10
- Summary of some simple ways to Reset Windows 10
1. Get the Windows image
Note: If your Windows 10 has been fully updated, installed software, created user accounts, customized Windows, skip from Step 1 to Step 3.
Step 1 . Full Windows 10 update.
Step 2 . Create a user account, install the software you want to use in the Windows recovery image.
Step 3. Customize Windows as you like, change the theme or other settings.
Step 4 . When finished, start the computer from the Windows installation media. When you see the Windows Setup screen select the keyboard and the area that appears, press Shift
+ F10
to open the Command Prompt.
Step 5 . Type DISKPART (1) and press Enter to start the disk partitioning utility.
Step 6 . When booting from Windows installation media, the drive letter may differ from normal boot. Enter the command LIST VOL (2) to check the partition character.
Step 7 . We need to get the Windows partition and save the install.wim file to another partition (internal or external drive) or on the shared network folder. Check the temporary drive letter for the Windows system partition. In this case, drive D: (3). If you save the image retrieved to another partition on the same computer, check its drive letter. In this example, you can select the drive E: (4) as the location to save the Windows image, but we will save it on the shared network.
Step 8 . Enter the EXIT command to exit DISKPART (5).
Step 9 . This is an optional step if you want to save the image on a shared network.
If you want to save the image on the shared network folder on another computer, you first need to initialize the network service with the wpeinit command (6), then map the shared folder on the computer to the drive letter localized.
The shared network path is servershare , where the server is the computer name with the shared folder or drive and share is the shared drive or folder name. In this case, we have the shared folder on the computer, AGM-W10PRO03 , called Storage and the path is AGM-W10PRO03Storage .
In this example, we will map the shared network directory to drive Z: use the following command. Enter the network login information (username and password for the server when notified (7):
net use Z: agm-w10pro03storage
Step 10 . Now, you can get Windows with a customized WIM file with DISM. Switch / imagefile: followed by the path and file name for the DISM command where the Windows image is stored. In this case, the image is saved to install.wim to the mapped network drive Z:. Switch / capturedir: Followed by the drive letter, colon, backslash says DISM knows which drive contains Windows installation (in this example D: drive). Change the information to your case.
The command to get image is as follows: (8)
dism / capture-image /imagefile:Z:install.wim / capturedir: D: / name: "Recovery" / compress: maximum
Step 10 . When done, close the Command Prompt, close the Windows Setup window and select the zone. Windows will restart and let the computer boot normally into Windows.
2. Prepare Recovery partition
Step 1 . Create a new partition on any internal HDD or SSD by minimizing the existing drive or using unallocated space, naming it Recovery .
The partition size should be the size of the custom install.wim file + 1GB, rounding up to the next full GB. That is, if the custom install.wim file is 6.2 GB, plus 1GB, we will have 7.2 GB, rounded up to 8GB (8,192 MB) for Recovery partition.
Step 2 . Mount Windows 10 ISO (same version and build number with Windows image) as a virtual DVD drive (right click on ISO image, select Mount ). Copy its content to the new Recovery drive.
Step 3 . On the Recovery drive, browse to the Sources folder and delete the install.wim or install.esd file in case your ISO is created with the Windows Media Creation Tool. Replace the deleted WIM or ESD file by copying the custom install.wim file into the same directory.
3. Add Recovery partition to the boot menu
Step 1 . Copy the following batch code and paste it into the new Notepad text file or 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%:sourcesboot.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 bootboot.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%:]sourcesboot.wim,{ramdiskoptions} bcdedit /set %guid% path windowssystem32winload.efi bcdedit /set %guid% osdevice ramdisk=[%DRIVELETTER%:]sourcesboot.wim,{ramdiskoptions} bcdedit /set %guid% systemroot windows bcdedit /set %guid% winpe yes bcdedit /set %guid% detecthal yes bcdedit /displayorder %guid% /addlast pause
Also you can download the batch file on this link.
https://www.tenforums.com/attachments/tutorials/197691d1532941989-factory-recovery-create-custom-recovery-partition-recovery.bat?s=1c599ef147ea184f6f34d5106dc66535
Note : Unblock the batch file before downloading.
Step 2 . This batch file is for UEFI-based computers with SSD / HDD GPT partitions. If your computer uses a BIOS-based system with an MBR-formatted drive, change the winload.efi in line 21 to winload.exe.
Step 3 . Save the file with the .bat file extension. Example: recovery.bat
Step 4 . Open Command Prompt as admin, run the batch with the full path. For example, if save it as recovery.bat in the Scripts folder on drive E:, enter the following command:
E: Scriptsrecovery.bat
Step 5 . The batch file will run, ask the drive letter for the Recovery partition you created and set the recovery environment to add it to the boot menu.
That's it, now you will have the Recovery option in the boot menu. Select it and run Windows Setup, you can install a new Windows 10, restore the custom image to the correct state when the custom image is created. Everything is still there, from custom themes, user accounts and installed software.
Tip: If the system disk has a problem and does not display the boot menu, you can restore it from the custom Recovery partition by booting from the Windows installation media and running Windows Setup manually from the Recovery partition.
For example : If your Recovery partition has a drive letter F :, launch Command Prompt by pressing Shift
+ F10
when Windows Setup displays the zone selection screen, then enter the following command:
F: Setup.exe
Windows Setup will run from the Recovery partition.
I wish you all success!
You should read it
- This is how to delete Recovery partition and Recovery partition 450 MB on Windows 10
- 3 ways to hide recovery partition (Recovery) on Windows 10 / 8.1 / 7
- How to create Mac Recovery HD on any drive
- Effective data recovery software on computers
- How to Create a Recovery Disk
- How to import Recovery Console in Windows XP?
- How to create a Windows 10 recovery USB when it fails?
- Windows File Recovery: Microsoft's free data recovery application
- Use volume HD Recovery to reinstall or troubleshoot OS X
- Remove 'reserve system' partition in Windows 7
- How to enter Recovery mode on Android phones
- Create recovery disk for Mac OS X Lion operating system
Maybe you are interested
How to fix the missing language bar error on Windows 11 extremely quickly
Turn off these visual effects to make Windows run smoother!
7 Ways to Customize Windows 11 Notepad
8 settings to change to make your Mac trackpad and keyboard work like Windows
How to add fonts to Word in Windows computer
How to use the file search command on Windows, find saved files