Make Your Own Automatic Windows Restore Partition (ImageX-based) - RMPrepUSB

Embed Size (px)

DESCRIPTION

Step by step guide to create a Windows restore partition like in laptops factory reset function!!!

Citation preview

  • Contents

    1 Introduction

    2 Version History

    3 Preparation

    4 Summary

    5 End User Experience

    6 Requirements

    7 Method

    8 What to do if the system does not boot at

    Step 9

    9 Making a new backup of Windows

    10 Automating the restore

    11 Making changes

    12 Getting HotKeys to work

    Download Videos Win7ToGo Win8ToGo Grub4dos Guide Hirens Easy2Boot

    Windows restore partition Fake Flash Test Remove Viruses GetWAIKTools Blog Sitemap

    RMPrepUSB - Home Page

    RMPrepUSB - What does it do?

    RMPrepUSB Quick Start Guide

    RMPrepUSB User Guide & FAQs

    RMPrepUSB FAQs

    RMPrepUSB - Version History

    RMPartUSB FAQs

    RMPartUSB Commands

    Forums (reboot.pro)

    Bugs - known, current and fixed

    Licensing of RMPrepUSB

    Contact Me

    Read and Sign my Guest Book

    Blog

    Latest Site News

    Hot Tips - good value/performanceUSB Flash memory pens

    Useful External Links (inc. Windows7/8/8.1 ISOs)

    Downloads

    Download

    Latest RMPrepUSB versions +downloads

    Tutorials, How To's and Guides

    01 - How to image a Windows systemusing a bootable WinPE USB driveand ImageX

    02 - How to create a USB drive thatwill install one of many choices ofWindows OS's (Vista/Win7/Server2008/XP)

    03 - How to install Windows XP froma bootable USB drive

    04 - How to boot directly from a USBdrive using an Emulator or VM underWindows

    05 - CHROMIUMOS - a browser OSon a USB Stick

    06 - YouTube Video Tutorials

    07 - All about 'Fake' SD cards andUSB Flash drives

    08 - Make a bootable USB drive forthe Norton Ghost SymantecRecovery Disk/Tool

    09 - How to make a bootableBACKTRACK 4/5 (linux) USB drive

    Tutorials, How To's and Guides >

    81 - Make your own automaticWindows restore partition (ImageX-based)

    Note: You mayalso beinterested in a

    CloneZilla-based Backup/Restore solution for Windowsin Tutorial 89 which is much easier to implement.

    Introduction

    If you have to install Windows for a friend who is not toocomputer literate and is likely to trash his copy of Windows,you may want a fast and easy 'Auto-Restore' or 'Reset'partition.If anything happens to the OS partition, then the end user cansimply pick the 'Restore' option from the boot menu to restorethe original Operating System in just a few minutes and with nofurther user interaction (typical restore times are XP OS=2minutes, Windows 7 OS=10 minutes).The procedure below will work on any Windows OS fromWindows 2000 or later.You can also take a backup at any time and overwrite theexisting backup.You could adapt this method and modify the restore process tojust delete the main Windows folder and a few other folder(e.g. program files, etc.) or just choose to not format thevolume and apply the image over the top of the existingWindows installation - however this is often unsuccessful as thesystem may still not boot or the user may get strange

    Search this site

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    1 of 16 14/4/2014 10:23

  • 10 - Boot BITDEFENDER RescueCD from USB as an ISO file

    11 - Make a free bootable imagerecovery USB flash drive usingFINNIX

    12 - Reset a Windows User password

    13 - How to find Windows Userpasswords using OPHCRACK 3.4

    14 - Crack or clear your BIOSpassword with PC CMOS CLEANER(uses Parted Magic)

    15 - How to emulate USB bootingusing Qemu Manager

    16 - How to boot to different WinPEversions using a single boot.wim thatcontains multiple images

    17 - StartOS - a 'Windows-like'version of linux on a stick

    18 - ISO Files - Burn, Extract, Mountor Edit ISO files

    19 - Create your own RMPrepUSBpackage using Nullsoft ScriptableInstaller (NSI)

    20 - Add MEMTEST86+ memory testprogram to your grub4dos menu.lstfile

    21 - GRUB4DOS GUIDE (withvideos) - how to make a multi-bootdrive (+examples)

    22 - How to boot PCLINUX (and mostother 'difficult' linux versions) withoutusing a 'flat-file' structure

    23 - How to fix a 'corrupt' USB drivethat causes Windows or RMPrepUSBto stop responding

    24 - Boot the Ultimate Boot CD forWindows (UBCD4WIN/XP) or BartPEfrom a USB drive (includes ISO boot)

    25 - Securely ERASE (wipe) yourhard disk of ALL data (beforedisposing of it)

    26 - Send and sniff commandsto/from your USB device (and seewhat your BIOS would see!)

    27 - Diagnose how your BIOS bootsUSB drives

    28 - Recover files and photos from acorrupt SD card or any drive (free!)

    29 - Boot Hirens Boot CD as an ISOfile from a USB drive (version 15.2)

    30 - How to install XP onto a HardDisk from an XP ISO on a bootableUSB drive

    31 - Boot and install Windows 7 orVista or Server 2008 (both 32 and 64bit) from ISO files from a singlebootable USB install drive

    problems. However, it may be useful to do this if you just wantto be able to boot to Windows to retrieve valuable files beforeyou do a full clean install. It is up to you to modify therestore.cmd script if you want to do this (e.g. do not run thediskpart script to format the C: drive first).

    Version History

    Auto_restore.zipv1 2012-07-01 First version - menu.lst has a typo and your OSmay not boot!v2 2012-07-02 The menu.lst file in the first version may causeproblems due to a typo! Please use version 2 (V.2) at thebottom of this page.If you have already installed the original menu.lst and have asystem which will now not boot to Windows, please proceed asfollows:

    1. Boot the target system to the grub4dos menu2. Type P3. enter the password rmprepusb (in lower case letters)4. Type C5. at the command prompt type root (hd0,0)6. Now type chainloader /ntldr if you have an XP system - or - type chainloader /bootmgr if you have a Windows Vista/7/8 system7. Type boot8. Now download the new version of menu.lst and put it on the C:\ drive andD:\ drive.

    v3 2012-07-02 Changed restore.cmd and backup.cmd to lookfor OS.tag to get the correct partition to backup or restore, sothat it now works if you have a boot partition and a systempartition.v4 2012-11-13 Changed windows menu again so looks for ntldror bootmgr and not OS.tag (some Win7 systems have a bootpartition and a system partition). Thanks to James for thisfeedback!

    Preparation

    It is assumed that you have already installed Windows XP,Vista, 7 or 8 onto a clean hard disk and that the OS has beensetup correctly for that system and that particular user.It is assumed that there is only one large partition on the harddisk which is the OS partition. If you have installed Windows 7or 8, you may have a small partition at the beginning of the diskfollowed by the larger OS partition.It is obviously easier if you can pre-partition the target system'shard disk to leave room for a backup partition at the end,however the instructions below show you how to shrink the lastpartition in case you have not left any spare unallocated spaceat the end of the hard disk.

    Summary

    Here is a quick summary of what we will do to make thisrestore partition on an existing Windows system's hard disk:

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    2 of 16 14/4/2014 10:23

  • 32 - Create a USB drive with multipleVista/Win7/Server2008 install ISOfiles in 3 simple steps!

    33 - How to create bootable 1.44MBand 2.88MB floppy disk images

    34 - The ZALMAN ZM VE200 SATAhard disk caddy with DVD/HDD/FDDemulation

    35 - How to make a bootable antivirusAVG RESCUE USB drive

    36 - Boot to Hiren's Boot CD from aUSB drive (v13/v14/v15.1/15.1DLC)

    37 - Create a DOS Bootable USBdrive (using grub4dos) suitable forBIOS flashing

    38 - Create an iGel UniversalDesktop Converter (UDC) installerUSB Flash pen

    39 - How to repair your USB Flashdrive

    40 - REDO, a Bare Metal Backup andRecovery solution

    41 - Microsoft Standalone SystemSweeper (MSSS) ANTIVIRUS BetaTool

    42 - Make a mini Windows 7 bootableUSB pen (using MAKE_PE3)

    43 - Install Windows 8, Server 2012,Win 7, 2K8 & Vista from multiple ISOfiles on the same Flash drive

    44 - USB Boot Kaspersky 10 & 2012Rescue Disk (AV)

    45 - How to PXE boot grub4dos orWinPE (from a Windows 7 PC) usingtftpd

    46 - Ubuntu 12.04/11.04/11.10 - bootfrom ISO

    47 - How to install Windows Vista/7/SVR2K8 onto a USB drive (or anypartition)

    48 - Is your BIOS lying to you aboutit's RAM memory size?

    49 - Control your Notebook/MediaCentre PC from your main PC withSynergy

    50 - Prepare a bootable USB driveusing linux commands

    51 - How to edit or make your ownLanguage.INI file for RMPrepUSB

    52 - Install Windows 8 as a VHD (noneed to re-partition!)

    53 - Windows 8/8.1 To Go (bootWindows 8 from a USB drive!)

    54 - How to Fix Write-ProtectedRead-Only Drives and SD Cards

    55 - Boot Slax from a USB drive

    Make a bootable version of WinPE v3 (Windows 7WinPE) using the free Microsoft WAIK (no Windows 7DVD or ISO required)

    1.

    Install EaSeus Home partition master (free) - onlyrequired if you have a Windows XP target system

    2.

    Shrink the last partition (usually this is the OS partition)3.Create a new primary NTFS recovery partition at theend of the hard disk

    4.

    Copy the WinPE boot files made in step 1 to the newpartition

    5.

    Install grub4dos to the MBR of the hard disk6.Hide the new WinPE recovery partition (optional)7.Uninstall EaSeus Home partition master (optional) 8.Reboot to WinPE9.Take a backup of the OS10.

    End User Experience

    Each time the system boots, the end user will see a menudisplayed for 5 seconds:

    Boot to WindowsRestore the original Windows image

    After 5 seconds (this timeout can be changed), the system willboot to Windows if no key is pressed by the user.If the end user selects the 2nd option by using the cursor keys,and then enters the password RESTOREME, the system willboot to WinPE.

    The user can then type D:RESTORE [or possibly E:RESTOREdepending on your partition arrangement] (this can beautomated so the user does not need to type anything) and itwill automatically wipe the original Windows installation andthen re-install Windows from the backup.

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    3 of 16 14/4/2014 10:23

  • 56 - Forgotten Windows password?No problem with Kon-Boot!

    57 - Automatic grub4dos menus,using hotkeys, hiding the menu andsilent startup

    58 - Trinity Rescue Kit - boot fromUSB

    59 - Save or list all your currentpasswords

    60 - Add Plop to your grub4dos menu

    61 - Run the OCZ SSD Firmwareupdate ISO from a bootable USBFlash drive

    62 - Chainload syslinux fromgrub4dos/grub and vice versa

    63 - Install XP and Win7 onto acomputer from one USB flash drivecontaining ISO files!

    64 - Boot Abstradrome HDDRegenerator from an image on a USBdrive

    65 - Make a grub4dos bootable ISO

    66 - Boot WifiWay/WiFiSlax wirelesssecurity OS from a USB drive(persistent)

    67 - Boot Fedora 16/17/18 withpersistence from a USB drive usinggrub4dos

    68 - WEE (wee63) andWEEsetup.exe - an alternativebootloader

    69 - Boot over the internet with iPXE

    70 - FbInst and other popular USButilities

    71 - Grubutils - menuset, wenv, bios,grub4dos utilities and batch files

    72 - Easy2Boot - a grub4dosmultiboot USB drive that is easy tomaintain!

    73 - Try Porteus with persistencebooting from an ISO using Easy2Boot

    74 - Boot Winternals ERDCommander from ISO or flat filestructure

    75 - Test your memory (RAM/DIMMs)

    76 - Quickly setup PXE booting toinstall any Windows OS or PXE bootlinux, etc.!

    77 - Create a multiple partition,multi-boot USB Flash drive underWindows

    78 - Run live XBMCbuntu from amultiboot USB drive

    79 - Make an RM Connect CC3 Multi-Station Build USB Flash drive

    80 - How to retrieve files from a

    A typical basic Windows XP system can be fully restored inabout 2 minutes, a basic Windows 7 system can be restoredin under 10 minutes.

    The system will then automatically reboot back to the restoredversion of Windows.

    There are instructions at the end of this tutorial on how toautomate the process so that the end user does not need totype D:RESTORE to start the image restore or even enter apassword.You can easily change the user experience by editing the scriptfiles and when you are happy that it is all working correctly, youcan hide the whole backup partition from the end user.

    Requirements

    You will need to use a Windows system (I will call thisyour 'office PC') to make a Windows 7 WinPEbootable OS.It is far more convenient if this is not the same systemas the target system.Install Virtual CloneDrive or ImDisk on your office PC.Download the Windows 7 WAIK (this is a LARGEdownload over 1GB!).Download a copy of EaSeus Home Partition masterinstaller onto a USB stick if your 'target system' is XPand has no internet access.Download RMPrepUSB (full version or portable) andextract it onto a USB stick (copy all files and folders notjust the exe file).The target system should have already been installedwith Windows, all drivers and software. It can have upto 3 primary partitions (or up to 2 primary partitions andany number of logical partitions).

    Method

    WARNING: This is intended to be used on a test 'target'

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    4 of 16 14/4/2014 10:23

  • computer without booting it to an OS(via PXE)!

    81 - Make your own automaticWindows restore partition(ImageX-based)

    82 - Install XP to hard disk from ISOsusing WinPE v3

    83 - Download ImageX, BCDBoot andother WAIK tools

    84 - Switch XP to AHCI mode

    85 - Add the O&O DiskImageProfessional ISO to your USBmultiboot drive

    86 - Dynamically change the diskvolume label using grub4dos

    87 - Install the Ultimate Boot CD ontoa USB drive

    88 - Boot Avira Rescue from USB

    89 - Automated Windows partitionbackup\restore boot menu usingCloneZilla

    90 - Install Windows 8 to a VHD fileon a USB drive!

    91 - Replace Windows XP/Vista/Win7with Windows 8 without a DVD orUSB drive

    92 - BITS - Intel BIOS ImplementationTest Suite

    93 - Boot almost ANY linux ISO froma grub4dos USB drive (e.g. Tails,BackTrack or even Ophcrack)!

    94 - Boot BackBox from your USBgrub4dos multiboot drive

    95 - Make a bootable WindowsRecovery USB Flash drive from aWindows 7 system

    96 - Add an automatic linux ISO filemenu to your grub4dos multibootUSB drive

    97 - Write-protect or make a CD/DVDpartition on a Flash Drive usingSMI_UFDiskUtilities

    98 - Add Linux Mint 14 ISO files toyour grub4dos multiboot USB drive

    99 - Boot Xiaopan with grub4dos

    100 - Make and boot from aWin8PE_SE ISO file

    101 - Patch a file using grub4dos

    102 - Speed up WinToFlash XPinstalls (+fix 'NTLDR is missing' error)

    103 - Fix or Repair XP if it is notbooting (using the XP RecoveryConsole)

    104 - Boot pclinux from ISO withpersistence

    105 - Clone your Windows XP Pro

    system and not on your main Windows PC. I strongly suggestyou test it out on a system containing non-essential files first!Please do not hold me responsible for any data loss if thingsgo wrong!

    1. Make a bootable version of WinPE v3 (Windows7 WinPE) using the free Microsoft WAIK

    Using your 'office' Windows XP/WindowsVista/Windows 7 PC (don't use the target system thatyou wish to image/restore):

    1.

    Download the Windows 7 WAIK ISO file (e.g.KB3AIK_EN.iso 1.7GB).

    2.

    Download and install your ISO mount utility. (e.g.VirtualCloneDrive or ImDisk) and use it to mount theWAIK ISO file

    3.

    The WAIK Welcome window should launch. If not,double-click StartCD.exe on the new drive letter inExplorer.You must agree to the Terms and Conditions and youshould have the correct licenses.

    4.

    Install the .Net Framework Setup from the WAIK menu.5.Install the MSXML 6 SP1 Setup from the WAIK menu.6.Install the Windows AIK Setup from the WAIK menu.7.Exit from the WAIK menu. The WAIK is now fullyinstalled. You can optionally install the WAIK v3.1 updatefiles too.

    Follow the next steps carefully to prepare a bootableWinPE OS...

    8.

    Click on Start Menu, All Programs, MicrosoftWindows AIK, Deployment Tools Command Promptto open up an Administrator command prompt window.

    9.

    Type copy ..\x86\imagex.exe c:\ and press Enter.10.

    Type COPYPE x86 c:\pe86 and press Enter.11.

    Type copy c:\pe86\winpe.wim c:\pe86\ISO\sources\boot.wim and press Enter.

    12.

    Type copy c:\imagex.exe c:\pe86\ISO and pressEnter.

    13.

    Download and unzip the filesinside AUTO_RESTORE.ZIP and copy them to theC:\pe86\ISO folder

    14.

    2. Install EaSeus partition master (free version)

    This next step is not necessary unless you have Windows XPon your target system. Windows Vista/7/8 Disk Managementcan be used instead to shrink the partition.

    1. On your target system, download and install EaSeuspartition master Home Edition

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    5 of 16 14/4/2014 10:23

  • system to a USB drive (usingUSBoot)

    106 - Boot any Linux LiveCD ISOfrom your Hard Disk

    107 - Quick way to make a WinPE v3and Backup/Restore ISO (usingMacrium Reflect)

    108 - XP Install using Rufus and addit to your grub4dso multiboot USBdrive

    109 - USB Rubber Ducky HackDevice (Hak5)

    110 - Run full Windows XP to Go!from a USB drive

    111 - How to semi-automate Windowsdriver installation

    112 - Virus/RootKit/RansomwareRemoval and CleanUp

    113 - How to use Easy2Boot withFlashBoot (for that odd system thatwon't boot properly)

    114 - How to make an Easy2BootMultiBoot USB Flash drive using linux

    115 - Convert a WinPE 'Flat-File' ISO(e.g. ESET SysRescue) to a ramdisk(boot.wim) ISO

    116 - Add Hirens 9.5 to your USBMultiboot drive (or Easy2Boot USBdrive)

    117 - Install Windows 98SE from anISO file on an Easy2Boot USB drive

    118 - Make bootable Clonezillabackup/restore USB Hard Disk

    119 - Boot HitManPro KickStart froma grub4dos multiboot USB Flashdrive

    120 - How to add RedHat Install ISOsto Easy2Boot

    Useful Articles

    Advanced Format (4K sector) harddisks

    Fix USB 3.0 'This device can performfaster' System Tray message!

    Download a whole website and viewit offline using wget!

    Getting started with the Raspberry Pi(RPi)

    Raspberry Pi + Motorola Atrix 4Glapdock

    Boot from CD/USB/Floppy to accessan NTFS partition

    Recording videos withCamstudio+Movie Maker forYouTube

    XP Setup CD/ISO Clean InstallationReference

    3. Shrink the last partition (usually the OSpartition)

    You need to make space for a partition that we can boot to atthe end of your target system's hard disk. You need to makethe size of the partition large enough to hold the backup imagefile.

    1. On the target system, in Windows Explorer, select all thefolders on the C: drive but do not select any of the files in theroot of the C: drive and then right-click and select 'Properties'.

    Windows Explorer should report the 'Size' (e.g. 6GB for atypical XP install + drivers, etc.).

    We will be using ImageX to make the backup and this doescompress the Windows files quite a lot (e.g. 6GB XP willproduce a 2GB backup file), so if Windows Explorer says thatthe target systems disk is say 500GB and has 480GB free,then you should probably make room for a 10GB partition.

    2. Run the EaSeus partition master application and select'Resize/Move partition'- or use Vista/Win7/8 Disk Manager toshrink the last partition.

    3. Slide the blue circle on the right-hand side ofthe EaSeus partition bar so that the 'Unallocated SpaceAfter' box reaches the desired partition size.

    4. Click on the Apply (tick) icon at the top and follow theinstructions to shrink the partition - a reboot may be required.

    Note: although you could also partition and format the newspace at the same time, I would recommend shrinking thepartition first as this is probably safer! Shrinking partitions cansometimes go wrong!

    4. Create a new primary NTFS recovery partition atthe end of the hard disk

    Once the EaSeus partition master has successfully createdsome space at the end of the hard disk on the target system,use the same application to partition and format the emptyspace as a Primary NTFS partition. You can use 'Change label'to call the Volume 'Backup' if you like. If you like you can useWindows Disk Manager instead of EaSeus to create a 'SimpleVolume'.

    5. Copy the WinPE boot files to the new partition

    Now copy and paste all the files and folders from theC:\pe86\ISO folder prepared in Step 1 above, to the newNTFS (D:) partition which is now at the end of the hard disk(use a USB Flash drive to transfer the files).

    6. Install grub4dos to the MBR of the hard disk

    The easiest way to install grub4dos onto the target hard disk isto use RMPrepUSB. You can either download the portable

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    6 of 16 14/4/2014 10:23

  • Reboot.pro Tutorials

    Sitemapversion and run it from a USB stick or copy the RMPrepUSBfolder from your office PC onto the USB stick or just installRMPrepUSB onto the target system.

    1. Run RMPrepUSB on the target system and type CTRL+F5once to toggle to the ALLDRIVES mode. Select the targetsystem's hard disk and click on the Install grub4dos button.Follow the prompts and press ENTER to allow RMPrepUSB tocopy over the grldr file.

    2. Copy the menu.lst file from the new partition (e.g. D:) to theC: partition. Grub4dos will use the menu.lst on C: unless it isaccidentally deleted by the user. Keeping a copy of menu.lst onthe D: drive acts as a backup.

    3. Do not delete or move the file recovery.tag from the backuppartition. Ensure the file recovery.tag stays on the new backuppartition (e.g. D:\)

    4. IMPORTANT: Move the file OS.tag to the root of C:\ (i.e.C:\OS.tag) - ensure that the file OS.tag is NOT on the D:volume or any other volume except the Windows C: systemvolume. Delete it from any other volume.

    The Windows Vista/7/8 Boot partition should be before theadded WinPE partition on the disk (the menu assumes that itwill always before the WinPE partition on the disk. You can tellwhere the Windows Boot partition is by looking at the hard diskpartitions using the Windows Disk Management tool(RMPrepUSB Crtl-K will launch this). The screenshot belowshows that the System and Boot volumes are on the samevolume - as long as the Boot volume is before the new WinPEvolume then the current menu will work correctly:

    If however, you have a Boot partition which is AFTER theadded WinPE partition (e.g. for some reason you have placedthe WinPE files before the Boot partition), you will need tospecify the partition number of the Boot partition in themenu.lst file by changing the Windows menu from:

    title Boot to Windows\nerrorcheck offfind --set-root /ntldr || find --set-root /bootmgrchainloader /ntldr || chainloader /bootmgr

    to

    title Boot to Windows\nerrorcheck offroot (hd0,1)chainloader /ntldr || chainloader /bootmgr

    where (hd0,1) is the partition that is the Windows Boot partition

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    7 of 16 14/4/2014 10:23

  • - where (hd0,0) is the first partition, (hd0,1) is the 2ndpartition, etc. - for instance, if the Windows 'Boot' partition isactually the 2nd partition and you have placed the WinPE fileson the first partition (which is unusual!), then change the menuentry to root (hd0,1).

    5. Copy the C:\grldr file that was put there by RMPrepUSBover to D:\grldr. This is a backup copy that can be used in casethe C: partition is destroyed.

    Target Hard Disk contents:

    C:\OS.tag - this marks which volume will bebacked up or restored toC:\menu.lst - this is the main user boot menufileC:\grldr - this is the main grub4dosprogram

    D:\recovery.tag - this marks the volume whichcontains the WinPE boot files and where the backup imagewill be storedD:\menu.lst - this is not normally used unlessthere is a problem booting - it should always be an exactcopy of the C:\menu.lst fileD:\imagex.exe - used to make backups andrestores D:\backup.cmd - script to take a backup of thevolume containing the OS.tag fileD:\reboot.cmd - script to reboot the systemD:\restore.cmd - script to restore the volumethat currently contains the OS.tag fileD:\auto\startnet.cmd - not actually used and can bedeletedD:\auto\Autorestore.cmd - not actually used and can bedeletedD:\bootmgr - the main boot loader file forWinPED:\grldr - the main grub4dos program -only used if the C:\grldr file is missingD:\boot folder D:\Sources folder - these contain the boot files forWinPE

    D:\OS.tag

  • the end use could easily assign a new drive letter in the sameway.

    Another alternative is, if you have Vista or Windows 7/8 (or ifyou boot to the WinPE partition), you can use diskpart to hidethe backup partition at any time, as follows:

    Open a Command Console with Administrator rightstype DISKPARTtype LIS VOL and not the drive letter of the newpartition (e.g. D:)type SEL VOL X (where X is the new drive lettertype SET ID=27type EXIT

    Note: To unhide the partition, set the ID as type 07 for NTFS.You can find the partition that you want to unhide by using theDISKPART commands SEL DIS 0, LIS PAR and then SEL PARN (where N is the partition number that you want to unhide)and then type SET ID=07 and EXIT.

    3. Right-click on the C:\menu.lst file and choose 'Properties'and click on the 'Hidden' and 'Read-only' tick boxes and thenclick on 'OK'

    4. Right-click on the C:\OS.tag file and choose 'Properties'and click on the 'Hidden' and 'Read-only' tick boxes and thenclick on 'OK'

    5. Right-click on the C:\grldr file and choose 'Properties'and click on the 'Hidden' and 'Read-only' tick boxes and thenclick on 'OK'.

    8. (optional) uninstall EaSeus Home partitionmaster

    Now prepare the system for imaging by uninstalling EaSeuspartition master and RMPrepUSB and any other applications orfiles that you do not wish the user to see when he/she restoresWindows.

    Run the disk cleanup tool and delete all IE browser history,cookies, etc. alternatively run CCleaner or a similar cleanupapplication.Imagex will not backup the page file or hibernation file so wedon't need to worry about these.

    9. Reboot to WinPE

    1. Now reboot the target system. You should see the grub4dosmenu appear for 5 seconds as the system boots:

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    9 of 16 14/4/2014 10:23

  • 2. Select the 2nd menu entry (as shown above) and then hit theEnter key to select the 'Restore' option - enter the passwordRESTOREME (in uppercase letters) when prompted.

    3. The target system should now reboot to WinPE and youshould see a black WinPE console window with a commandprompt.

    4. (optional) Check that the system will still boot to Windows bytyping D:reboot (or possibly E:reboot) at the command lineand letting the menu timeout so that the system reboots toWindows.

    Note: See below if the system does not now boot correctly!

    10. Take a backup of Windows

    Note: If you have enabled the automated restore feature (asdetailed in the section below), then when you are prompted toperform a restore (Y/N) ? type the uppercase letter B to runbackup.cmd.

    1. We now need to make a backup, so reboot to WinPE (selectthe Restore option in the grub4dos menu) and type D:backup(or maybe E:backup) and hit the Enter key to start the backupof the OS volume (which may be called D: when booted toWinPE). The Windows volume that contains the file OS.tag willbe backed up to a file backup.wim on the backup volume.

    2. Once it completes successfully, type D:reboot and hit theEnter key to return to boot to Windows again.

    If you don't want to hide the restore partition so that the usercan make use of the unused free space, then I suggest youset the Hidden attributes on all the files, so that the user isunable to see them easily and thus prevent him/her deletingthem accidentally.

    If you want to maximise the amount of available space on theOS drive and reduce the size of the backup partition to theminimum, you will need to resize the backup partition. This canbe done as follows:

    Note the size of all the files (including the backup.wimfile) on the backup partition (e.g. say it is 6GB)

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    10 of 16 14/4/2014 10:23

  • Copy all the files to a folder on the C: drive (e.g.C:\TEMPBAK)Delete the backup partition using Disk Manager orEaSeus partition masterResize the C: partition to expand it so that it leaves justenough space for the backup files (allow at least 500MBextra just to be safe!) - so leave 6.5GB unallocated inthis exampleCreate a new NTFS Primary backup partition in theremaining spaceCopy all the files from C:\TEMPBAK to the new volumeDelete the C:\TEMPBAK folderHide the backup volume if desired or remove it's volumeletter using Disk Manager

    What to do if the system does not bootat Step 9

    Don't Panic!

    If you rebooted the system at Step 9 and it did not show themenu with the two items in it, but you have a prompt like this:

    grub>then you probably do not have a menu.lst file present. You cantry booting back to Windows by typing in the grub4dos console:

    If you have Windows XP:find --set-root /ntldrchainloader /ntldr boot

    or if you have Windows Vista or later:find --set-root /bootmgrchainloader /bootmgrboot

    The target system should then boot to Windows correctly andyou can fix the problem.

    You can also get to the grub4dos command prompt by typing Pand then entering the password rmprepusb when prompted.Then type C for the command prompt.You can examine the hard disk contents by typing

    findand then list the directory contents of each partition by typing

    ls (hd0,0)/ls (hd0,1)/

    etc.etc.

    If the system always boots to the WinPE shell, check that theWindows Boot partition is before the added new WinPEpartition. If not see Step 4 above.

    If all else fails, boot WinPE from a USB stick or a Windowsinstallation DVD and check the files.

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    11 of 16 14/4/2014 10:23

  • Note: When testing the target hard disk boot menu and backupand restore, always remove your USB drive from the targetsystem as it may contain OS.tag and Restore.tag files whichwill confuse the menu system!

    If you want to remove the grub4dos boot loader and just goback to booting the hard disk straight to Windows, you can dothis using RMPrepUSB as follows: hit CTRL+F5 to show alldrives - select the hard disk in the disk list box - CTRL+B toinstall the standard Windows MBR boot code. To runRMPrepUSB, you can boot from a WinPE USB stick, Windowsinstall DVD or if possible, from the WinPE installed on yourhard disk via the grub4dos menu, and then run RMPrepUSBdirectly from a USB flash drive.

    You can make a bootable WinPE USB Flash drive simply byformatting the USB Flash drive using RMPrepUSB with theWinPE v2/v3 [bootmgr] radio button ticked and then copy allthe files from C:\pe86\ISO over to the USB Flash drive. Thisshould get you out of any problems if you cannot boot yourhard disk at all!

    Making a new backup of Windows

    If for any reason you want to make a new backup, then justboot to the WinPE partition again and type D:backup. The oldbackup.wim file will be erased and a new one created.Note: If you have previously made the backup.wim fileRead-Only then the operation will fail.

    Automating the restore

    If you want to make it really simple for the user so that he/shedoes not have to type d:restore when they get to the commandprompt, then you can modify the boot.wim file as follows:

    1. On the 'office' system, launch the WAIK command shell(right-click - run as administrator) window using the Start Menu.Close all other cmd and Explorer windows.

    2. Type mkdir c:\pe86\mount to create an empty folder

    3. Type dism /Mount-Wim /wimfile:C:\pe86\iso\sources\boot.wim /index:1 /Mountdir:C:\pe86\mount

    4. You can now use Windows Explorer to edit the image whichyou will find at C:\pe86\Mount. Note: If using Windows XP, youare advised to hold down the SHIFT key if deleting files or foldersin the image.

    5. Copy the two files startnet.cmd and autorestore.cmd,which can be found in the downloaded AUTO folder, onto theC:\pe86\mount\windows\system32 folder (this overwrites theexisting startnet.cmd file).

    6. Commit the changes to boot.wim using the

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    12 of 16 14/4/2014 10:23

  • command: dism /Unmount-Wim /MountDir:C:\mount/commit

    Note: If you do not want to keep the changes,use /discard instead of /commit. Read the WAIK .chm helpfiles for more information.

    7. Now replace the \sources\boot.wim on your targetsystem's recovery partition with the new version fromyour office PC's C:\pe86\iso\sources\boot.wim (transferit using a USB Flash drive).

    When WinPE boots, it will now find and run \restore.cmd on thebackup partition automatically.

    If you now want to run a backup and overwrite thecurrent backup.wim file, then type the secret key Bwhen prompted to answer Y or N. If you want to get to the command prompt, then type Bagain when backup.cmd prompts you to make a backup.

    If you don't want any user password for the Restore menuoption, simply comment out the password line in C:\menu.lstwith a # character as shown below:

    title Restore the original Windows image\nTip: Thepassword is RESTOREME\nThen type RESTORE torestore the original Windows image# password RESTOREMEfind --set-root /recovery.tagchainloader /bootmgr

    Making changes

    Make sure that any changes you make to the menu.lstfile are also made to the copy of menu.lst on the otherpartition. As this is a backup menu, it will become activeif your other partition becomes corrupt. If you havechanged the partitions around, you may find that theother menu.lst is used, so always duplicate any changesby copying the modified menu.lst to overwrite the 2ndcopy.The menu timeout that appears for 5 seconds is actuallyderived from C:\menu.lst file. You can add a backgroundimage and modify the menu itself. Look at Tutorial #21for details about grub4dos and on how to change themenu.You can change the menu password (or remove it) byediting the C:\menu.lst file.The script (.cmd) files are run from the backup/recoverypartition, these files are restore.cmd and backup.cmd.Restore.cmd will format the drive that contains OS.tagand then apply the backup image to the same volume.You can edit these files also, if you wish. Do NOTdouble-click on them if you are running Windows!If you have a Windows system with a boot partition anda system partition, the end user will have to typeE:RESTORE instead of D:RESTORE - in this case youwill need to change the help message in the C:\menu.lstfile from D: to E: (see red text in menu below). If your

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    13 of 16 14/4/2014 10:23

  • target hard disk has more partitions, you may need totype F:RESTORE or even G:RESTORE.Always keep a copy of C:\menu.lst on D:\ in case the C:volume is accidentally wiped, so that you can boot toWinPE and restore the system again. The same appliesfor the grldr file too.The .tag files must not be deleted, as these determinewhich OS is booted and where the backup image iskept.If you have used the startnet.cmd and autorestore.cmdfiles to modify the \sources\boot.wim file, do not changethe name of \restore.cmd because autorestore.cmdlooks for this file. If you want to run a different file, thendelete the contents of \restore.cmd and then add in aline inside it to call your own script or executable.If you want to edit the C:\Menu.lst file and have set theproperties to hidden and read-only, you must unsetthese first before you can change the contents. If youare at the WinPE command console, you can do thisusing NotePad and then use File - Open and thenright-click on the C:\menu.lst file and chooseProperties, then untick the read-only checkbox.The password rmprepusb statement in the menu.lstfile prevents the end user from being able to edit themenu.lst file when the menu is loaded (as grub4dosnormally allows this and the end user could see therestore password). If you want to change the menuwhilst it is running, then type P and then enter thepassword rmprepusb - now you can edit the menuusing E or gain access to the grub4dos console bytyping C. Note that any menu changes you make aremade to a copy in memory and so are not permanent,they are just valid for that session and do not actuallychange the contents of the c:\menu.lst file. In edit modeyou can add, delete or change any line in a menu andthen hit the ESC key to get back to the user menu andtest out the changes. See Tutorial #21 for more details.You can encrypt the passwords in the menu.lst so thateven if the user can view the menu.lst file, he will justsee gibberish text. This is done by finding the md5 hashof your password and using the syntax: password--md5 $1$6$ftCQWsyP7jK5sUt/JMHMi/

    see the grub4dos tutorial here for more details.

    menu.lstwrite (md)0x220+1 !BAT\necho -n -P:0000$[0133] --- BOOT MENU --- \0 initscript (md)0x220+1

    password rmprepusb

    default 0timeout 5color white/blue color normal=0x0c highlight=0x1e helptext=0x0Dstandard=0x02 border=0x0c

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    14 of 16 14/4/2014 10:23

  • title Boot to Windows\nerrorcheck offfind --set-root /ntldr || find --set-root /bootmgrchainloader /ntldr || chainloader /bootmgr

    title Restore the original Windows image\nTip:The password is RESTOREME\nThen typeD:RESTORE to restore the original Windowsimagepassword RESTOREMEfind --set-root /recovery.tagchainloader /bootmgr

    Getting HotKeys to work

    If you want the grub4dos menu to work with hotkeys, then lookat Tutorial 57. Simply download the hotkey file from Tutorial 57and add it the same folder as the menu.lst file. Then add theline /hotkey to the top of the menu and add the text ^F4 to therestore menu: e.g.

    /hotkeywrite (md)0x220+1 !BAT\necho -n -P:0000 $[0133] --- BOOT MENU --- \0 initscript (md)0x220+1

    password rmprepusb

    default 0timeout 5color white/blue color normal=0x0c highlight=0x1e helptext=0x0Dstandard=0x02 border=0x0c

    title Boot to Windows\nerrorcheck offfind --set-root /ntldr || find --set-root /bootmgrchainloader /ntldr || chainloader /bootmgr

    title ^F4 F4 Restore the original Windows image\nTip:The password is RESTOREME\nThentype D:RESTORE to restore the original Windowsimagepassword RESTOREMEfind --set-root /recovery.tagchainloader /bootmgr

    | | | |

    AUTO_RESTO Steve Si, v.4

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    15 of 16 14/4/2014 10:23

  • Google

    81 - Make your own automatic Windows restore partition (ImageX... http://www.rmprepusb.com/tutorials/auto_restore

    16 of 16 14/4/2014 10:23