Torrentus wrote: @parapher This means you install Windows on VM, run all registry cleaners, then use sysprep to capture the image?
Is this method hardware independent? That would be great if so, I will definitely look into it!
Edit: I have installed my slimmed down Windows 7 SP1 x64 Micro Edition and made a full registry backup. The reg file is 129 MB big.
After using CCleaner, Wise Registry Cleaner and Glary Utilities they removed over 4000 faulty registry entries. After that I once again made a full registry backup and the size
was only 79,4 MB big. That's nearly 50 MB smaller, totally insane if you ask me...
Yes, it will be hardware independent completely.
Basically, what you do is install your Win7 original image in a VM; VirtualBox (which is what I use) lets you create a VHD for your VM, so when you create it, create is as a VHD (not VDI which is default). Then go about installing Windows 7 as usual. Then, as you get presented with the window to create your user account name, instead of logging into Windows, you press CTRL-SHIFT-F3. This will make your install reboot and run in Audit mode. After reboot it will automatically boot to desktop but the little sysprep window will pop up. Just exit it (X). Also, the network (Home, Public, etc.) window will come up so go ahead and exit that (it won't appear anymore after first boot). The sysprep window will pop up every time you reboot Windows, but you can reboot as many times as you want, it doesn't matter. Just exit the sysprep window every time. So install your non-integrateable updates, clean your registry, etc.
Then to remove all re-arms of Windows (makes your base image have same number of re-arms as original image) I use the following trick. Make a little .bat file called something like 'delwpa.bat'. In the .bat file put the following lines:
Code:
reg load HKLM\MY_SYSTEM "%~dp0Windows\System32\config\system"
reg delete HKLM\MY_SYSTEM\WPA /f
reg unload HKLM\MY_SYSTEM
OK, place the delwpa.bat on the root of your install in the VM (C:\). Then, mount your Win7 .iso which you installed from in the VM (just go to the VM windows and go to 'Devices->CD/DVD Devices and navigate to where you have your .iso). Then, reboot, and press a key to enter setup from your iso. Instead of installing, choose the Repair option. Then a little window will load that lists your Win7 install, OK that, and then choose the Command Prompt option. When that comes up, run the delwpa.bat from your VM install. Even though the VM install (inside the install) thinks it's drive C:\, when you actually address it in the command prompt in the repair option, it will have become drive D:\ instead. So in the command prompt run D:\delwpa.bat. With a second this will wipe the previous arms. Then, restart (don't press key) and let it boot back into Windows.
Now any grace period or trial activation data will be deleted so you have to give a command from within your VM install to feed it the key to your Windows version again (in the mean time you may get the message on your right bottom desktop corner that Windows isn't activated, just ignore). Each version (Pro, Ultimate, etc.) will have its own key. So open the command prompt as Administrator and run the following line:
Code:
C:\Windows\System32\slmgr.vbs /ipk HYF8J-CVRMY-CM74G-RPHKF-PW487
This above example is for Win7 Pro, so use the appropriate key for your version of Win7. The keys are as follows:
Ultimate:
D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV
Professional:
HYF8J-CVRMY-CM74G-RPHKF-PW487
Home Premium:
RHPQ2-RMFJH-74XYM-BH4JX-XM76F
Home Basic:
YGFVB-QTFXQ-3H233-PTWTJ-YRYRV
Starter:
7Q28W-FT9PC-CMMYT-WHMY2-89M6G
So after feeding the key command to Windows, it will take a few seconds and then your key will be installed. If you want to check your trial activation and re-arm count, you can enter the following line in command prompt to check: C:\Windows\System32\slmgr.vbs /dlv
Now, make sure any mounted .iso is ejected from the VM CD drive and delete the delwpa.bat from C:\ and reboot. As usual, the sysprep window will come up again. This time, don't exit it, but choose the following options:
"Enter System Out-of-Box Experience (OOBE)" -> Select "Generalize" box -> "Shutdown". Click OK.
Now sysprep will run for 30 seconds or less and the VM will shut down. In your VM folder (usually: C:\Users\{username}\VirtualBox VMs) you will now have a big .VHD file containing your sysprep'd VM install.
OK, since you created the VM as a VHD, you can use Disk Management directly to 'attach' (mount) it. Open Disk Management, go to 'Action->Attach VHD' and navigate to your VHD file. The VHD will now mount to a drive letter. You can then capture that drive via Imagex.exe. Personally I always do it manually with a script that calls a sort of portable version of WAIK I install on my installs. So inside the script I have:
Code:
"C:\ppApps\WAIK\Tools\amd64\imagex.exe" /compress maximum /flags "Professional" /capture m: h:\install.wim "Windows 7 Professional" "Windows 7 Professional"
In this example, I'm using a Win7 Pro image and the mounted VHD is drive M, and I want to save the captured image/install.wim to drive H:\ on my computer. Or you can just use some tool (probably Gimagex can do this?). Then the image will get captured from the VHD and saved into an install.wim. You then have your delicious base image
Let me know if you have any questions.