Thanks for the link. I tried to product, it's very hard to automate. It's very good for manual setup but it isn't what I am looking for.
Yes, that's what I need. I'm gonna add an entry to boot a WinPE, that will execute a batch that will format and apply an image on drive C.
I'll keep you updated on the progress.
Thanks for the idea.
Windows 7 Recovery Project
Purpose
Usb flash drive with bootable WinPE
Holds wim image
Formats full disk and creates 2 partitions – recovery and system
Restores recovery wim to recovery partition
Restores system wim to system partition
Setid on drive – Hidden or Not
Set system partition to active
Reboot and setup windows as normal (including user documents?)
Stages
Stage 1- Blank Hard drive Restore
Stage 2- Setup user
Set up utils folder (containing batch files imagex etc.)
Stage 3- Enter recovery Mode
Stage 4- From Recovery Mode Capture system drive now complete and set up
Stage 5- Switch back to Normal Mode issue to user
Stage 1
Using WinPE restore image this will clean drive create 2 partitions recovery and system
Set system drive to active
Restore windows to system drive
Restore recovery to recovery drive
Reboot
Stage 2
Setup windows as per normal
Copy user document
Apply latest updates
Copy Utils folder from R:\Utils to c:\windows\system32
Thus creating C:\windows\system32\utils
From this folder run Recovery.bat
This will set partition 1 to active, un-hide Recovery partition (currently not hidden) and display a message box with a countdown
Stage 3
Recovery mode
Run Menu.bat
3 options 1 hidden
1. I have changed my mind get me back to windows 7 Press 1 then enter
2. Restore my drive to the state it was issued to me – WARNING THIS IS A DESTRUCTIVE RESTORE – your file not backed up will be destroyed – Press 2 then press enter
3. Not shown Type Create – This will capture the system drive
(Future option create 3rd partition for data? Thus non-destructive restore)
Scripts
Disk part script for full install
Select disk 0
Clean
Create partition primary size=20480
Select partition 1
Assign letter=R format fs=ntfs label=”Recovery” quick
Create Partition primary
Select Portion 2
Assign Letter=C Format fs=ntfs Label=”System” quick
Select Partition 2
Active
Exit
Disk part Script for System Drive
Select Disk 0
Select Partition 1
SetId=07 Override
Active
Exit
Disk part Script To Set Standard Mode
Select Disk 0
Select Partition 1
SetId=17 Override
Select Partition 2
Active
Exit
Recovery.bat
Diskpart /s Diskpart script full path
Rem to change active partition (script)
Rem to unhide Recovery Partition (script)
Rem to set recovery partition active(script)
Shutdown –r –c “Switching to Recovery Mode”
Nrestore.bat
Diskpart /s Diskpart script full path
Rem to change active partition (script)
Rem to hide Recovery Partition (script)
Rem to set system partition active(script)
Wpeutil reboot
Restore.bat
Start / Wait imagex /apply c:\images\backup.wim 1
Diskpart /s Diskpart script full path
Rem to change active partition (script)
Rem to hide Recovery Partition (script)
Rem to set system partition active(script)
Wpeutil reboot
Create.bat
Start / Wait imagex / capture c: r:\images backup.wim
Diskpart /s Diskpart script full path
Rem to change active partition (script)
Rem to hide Recovery Partition (script)
Rem to set system partition active(script)
Wpeutil reboot
Menu.bat
@Echo Off
Cls
Color 0a
Title Recovery Menu
Echo Welcome to the Recovery Section
Echo.
Echo You Now Have Two Options
Echo 1. I Have Changed my Mind Get Me Back to Windows 7
Echo Press 1 followed by the enter key
Echo.
Echo 2. I want to Restore My Computer To The State It Was Issued to Me
Echo WARNING THIS IS A DESTRUCTIVE RESTORE – if you have not backed up your files use option 1 first!
Echo Press 2 followed by the enter key
Echo.
Echo.
Echo Enter Your Choice Now?
If 1 call Nrestore.bat
If 2 call Restore.bat
If Create call create.bat
If menu re run menu .bat
Edited by Dangerous85, 21 December 2016 - 03:16 PM.