Guys, I have great news
. I finally got Sysprep with Copyprofile functional.
This tutorial will teach you how to clean, tweak, defrag your registry, configure and boost up your Windows before Installation.
You should do this as the final step when you finally made your perfect slimmed down Windows ISO. Don't be scared of the length,
I wrote this tutorial totally bulletproof that even beginners can follow and finish it successfully, it's in fact really simple
----------------------------------------------------------------------------------------------------------------------------
1. Create your Virtual Hard Drive as VHD (Virtual Hard Disk) and install your Windows in VirtualBox.
2. During Windows Installation when you setup your Computer Name press Ctrl+Shift+F3, this will boot your Windows into Audit Mode and you will be logged as Administrator.
Close the Sysprep Popup.
3. In VirtualBox, setup a folder for sharing and install VBoxGuestAdditions. Restart your Virtual Windows as prompted.
Close the Sysprep Popup.
4. Download the latest CCleaner portable version! http://www.piriform.com/ccleaner/download/portable/downloadfile
Download the latest Wise Registry Cleaner portable version! http://www.wisecleaner.com/soft/WRCFree.zip
Download the Glary Utilities 2.56.0.8322 portable version! http://download.glarysoft.com/guportable.zip
Extract all and put it into your share folder.
5. Copy all three registry cleaners to your desktop and start cleaning with CCleaner, then Glary Utilities and Wise Registry Cleaner
(!!! Important Scan and clean the registry like 3 times with each program until no errors occur !!!)
Also exclude and uncheck in Glary Utilities after Scan for Issues in Show Details following registry entry, it could cause problems with Windows Activation: HKEY_CLASSES_ROOT\ADODB.Stream.6.0\CLSID Here are my personal results:
CCleaner - First Scan 1412 errors, Second Scan 328 errors, Third Scan 69 errors, Fourth Scan 0 errors
Glary Utilities - First Scan 2247 errors, Second Scan 1 error, Third Scan 0 errors
Wise Registry Cleaner - First Scan 37 errors, Second Scan 2 errors, Third Scan 0 errors
After successfully cleaning, go to Wise Registry's System Tuneup Tab and click Optimize to boost Windows performance.
Reboot your Windows.
6. Close the Sysprep Popup, configure and setup your Windows how you want it to be and uninstall VirtualBox Guest Additions. When prompted restart your virtual Windows.
7. Close the Sysprep Popup and delete the leftover folder: C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Oracle VM VirtualBox Guest Additions
Now start again CCleaner and cleaning again, also clean all Windows temp files ( Check all Boxes ), then Glary Utilties. After Glary Utilities delete both CCleaner and Glary Utilities folder
from your desktop and empty your trash bin. Now start Wise Registry Cleaner, clean again your registry, click on Registry Defrag and Analyse, when it's finished on Defragment
to further optimize your entire registry. Click on Yes to execute the task and reboot your Windows.
This whole procedure is necessary because through Windows restart and deleting the programs, new registry errors will come up again.
Here are my personal restults:
CCleaner - First Scan 158 errors, Second Scan 0 errors
Glary Utilities - First Scan 0 errors
Wise Registry Cleaner - First Scan 2 errors, Second Scan 0 errors.
Now also delete the Wise Registry Cleaner folder from your desktop and delete the folder: C:\Users\Administrator\AppData\Roaming\Wise Registry Cleaner.
Empty your trash bin.
8. In your Virtual Windows click on the Windows Start Button and type regedit to go to your Registry Editor.
Go to HKEY_CURRENT_USER\SOFTWARE and delete the GlarySoft folder. ( This is a registry leftover from Glary Utilities )
Go to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ and delete GlarySoft and Oracle ( This is a registry leftover from Glary Utilities and VBoxGuestAdditions )
Go to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Tracing\ and delete WiseRegCleaner_RASAPI32 and WiseRegCleaner_RASMANCS ( These are registry leftovers from Wise Registry Cleaner )
Close the Registry Editor.
9. Go to Windows\System32\sysprep and start sysprep.
The sysprep will popup, configure System Cleanup Action to Enter System Out-of-Box Experience (OOBE), check Generalize and Shutdown Options to Shutdown.
Click OK, sysprep will configure your system and shutdown.
10. On your Host Windows go to Computer Management and click on Disk Managment. Go to Action -> Attach VHD and select your existing VHD from Virtualbox and click OK.
This will mount your Virtual Windows from VirtualBox. In the root delete the pagefile.sys.
11. This OPTIONAL step is for Advanced Users who want their free space back, you can skip this if you don't care about a bigger Windows ISO.
( This will get your original or even smaller install.wim size, otherwise your ISO will be about 35-40 MB bigger ).
Delete in your mounted VHD Windows:
Code:
ProgramData\Microsoft\Network\Downloader
ProgramData\Microsoft\Windows\Caches - delete all files inside
ProgramData\Microsoft\Windows\Power Efficiency Diagnostics - delete all files inside
Users\Administrator\AppData\Local\Microsoft\Windows\1033
Users\Administrator\AppData\Local\Microsoft\Windows\Explorer - delete all files inside
Windows\debug - delete all files inside
Windows\inf - delete all .pnf files inside
Windows\Logs\CBS\CBS.log
Windows\Panther
Windows\Prefetch
Windows\Security
Windows\Tasks
Windows\setupact.log
Windows\setuperr.log
Windows\WindowsUpdate.log
Windows\System32\catroot2\ - delete all .log and .txt files
Windows\System32\catroot2\{127D0A1D-4EF2-11D1-8608-00C04FC295EE}\catdb
Windows\System32\catroot2\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\catdb
Windows\System32\CodeIntegrity\bootcat.cache
Windows\System32\DriverStore\INFCACHE.1
Windows\System32\DriverStore\ - delete all .pnf files
Windows\System32\LogFiles\AIT - delete all files inside
Windows\System32\LogFiles\Scm - delete all files inside
Windows\System32\LogFiles\WMI\RtBackup - delete all files inside
Windows\System32\sysprep\Panther
Windows\System32\sysprep\Sysprep_succeeded.tag
Windows\System32\wdi\LogFiles - delete all files inside
Windows\System32\winevt\Logs - delete all files inside
Windows\System32\SET3472.tmp
Windows\System32\PerfStringBackup.TMP
Windows\System32\SysFxUI.dll
Windows\System32\en-US\SysFxUI.dll.mui
Windows\System32\WMALFXGFXDSP.dll
Windows\SysWOW64\config\DEFAULT.bak
Windows\SysWOW64\config\DEFAULT.rhk.LOG1
Windows\SysWOW64\config\DEFAULT.rhk.LOG2
Windows\SysWOW64\config\SAM.bak
Windows\SysWOW64\config\SAM.rhk.LOG1
Windows\SysWOW64\config\SAM.rhk.LOG2
Windows\SysWOW64\config\SECURITY.bak
Windows\SysWOW64\config\SECURITY.rhk.LOG1
Windows\SysWOW64\config\SECURITY.rhk.LOG2
Windows\SysWOW64\config\SOFTWARE.bak
Windows\SysWOW64\config\SOFTWARE.rhk.LOG1
Windows\SysWOW64\config\SOFTWARE.rhk.LOG2
Windows\ServiceProfiles\LocalService\NTUSER.bak
Windows\ServiceProfiles\LocalService\NTUSER.DAT.LOG1
Windows\ServiceProfiles\LocalService\NTUSER.DAT.LOG2
Windows\ServiceProfiles\LocalService\NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TM.blf
Windows\ServiceProfiles\LocalService\NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000001.regtrans-ms
Windows\ServiceProfiles\LocalService\NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000002.regtrans-ms
Windows\ServiceProfiles\LocalService\NTUSER.DAT{57b4d45a-ca12-11e3-b15e-d37e9197c7d9}.TM.blf
Windows\ServiceProfiles\LocalService\NTUSER.DAT{57b4d45a-ca12-11e3-b15e-d37e9197c7d9}.TMContainer00000000000000000001.regtrans-ms
Windows\ServiceProfiles\LocalService\NTUSER.DAT{57b4d45a-ca12-11e3-b15e-d37e9197c7d9}.TMContainer00000000000000000002.regtrans-ms
Windows\ServiceProfiles\LocalService\NTUSER.rhk.LOG1 Windows\ServiceProfiles\LocalService\NTUSER.rhk.LOG2
Windows\ServiceProfiles\NetworkService\NTUSER.bak
Windows\ServiceProfiles\NetworkService\NTUSER.DAT.LOG1
Windows\ServiceProfiles\NetworkService\NTUSER.DAT.LOG2
Windows\ServiceProfiles\NetworkService\NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TM.blf
Windows\ServiceProfiles\NetworkService\NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000001.regtrans-ms
Windows\ServiceProfiles\NetworkService\NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000002.regtrans-ms
Windows\ServiceProfiles\NetworkService\NTUSER.DAT{57b4d458-ca12-11e3-b15e-d37e9197c7d9}.TM.blf
Windows\ServiceProfiles\NetworkService\NTUSER.DAT{57b4d458-ca12-11e3-b15e-d37e9197c7d9}.TMContainer00000000000000000001.regtrans-ms
Windows\ServiceProfiles\NetworkService\NTUSER.DAT{57b4d458-ca12-11e3-b15e-d37e9197c7d9}.TMContainer00000000000000000002.regtrans-ms
Windows\ServiceProfiles\NetworkService\NTUSER.rhk.LOG1
Windows\ServiceProfiles\NetworkService\NTUSER.rhk.LOG2
12. On your Host Windows click on the Windows Start Button and type regedit to go to your Registry Editor.
You need to fix the language bar that will appear on top default that was reseted by sysprep.
Select HKEY_LOCAL_MACHINE and then click on File -> Load Hive and select from your VHD Users\Administrator\NTUSER.DAT to load.
Name it VHD_ADMINISTRATOR, open it and go to Software\Microsoft\CTF\LangBar\ click on ShowStatus and set a Value ( 1 = taskbar , 3 = hidden )
Then select VHD_ADMINISTRATOR and click on File -> Unload Hive and click on YES and close the Registry Editor.
13. Now you need to capture your VHD , start WinToolkit and go to Tools -> Imaging -> Capture Image
In the Block "Select a WIM File" click on New WIM and Save, select your output folder and name the file install.wim
In the Block "Folder to Capture" select your VHD where your virtual Windows is stored.
In the Block "Info" you can name your Windows Version if it's blank, most of the time its automatically filled.
In the Block "Compression" select Maximum
Click on Start
14. Now extract all content from your slimmed ISO to a new folder and replace the new install.wim with the old one.
Here comes to IMPORTANT PART ( this is for Windows 7 64bit only ), if you already have an Autounattend.xml in your ISO root you need to copy these 2 components into your xml:
Code:
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CopyProfile>true</CopyProfile>
</component>
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
If you don't have an Autounattend.xml you need to create one in Notepad and paste this code, save it as Autounattend.xml and copy this file into your root from your extracted ISO folder:
Code:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CopyProfile>true</CopyProfile>
</component>
</settings>
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
</settings>
</unattend>
15. Now switch to WinToolkit go to the Basic Tab and click on ISO Maker.
In the block "Folder to capture" select your folder where you extracted your Windows ISO and pasted your new Autounattend.xml
In the block "Label" name your Windows
In the block "ISO Output" select where you want to save your new ISO and name it.
In the block "Options" uncheck Rebuild Image"
Click on Start
16. On your Host Windows go to Disk Managment, select your VHD, right click and Detach VHD. Click on OK. Install your Windows as usual and enjoy!
If you've followed exactly this tutorial you will get no registry errors after Windows installation, your registry will be already defragged and your Windows performance better!
----------------------------------------------------------------------------------------------------------------------------
When you are using Winreducer without this method there will be still registry errors after Windows installation, let me explain how this is happening. You have booted into the Administrator account and cleaned
there multiple times the registry. When you sysprep your Windows, your system will be re-configured and generalized. The trick here is to use the Copyprofile option afterwards which is set in the Autounattended.xml.
This will copy everything ( even the registry ) from your Administrator Account to your Default Account. Everytime you create a new Windows Account, you will inherit the same settings.
Winreducer partially cleans the registry while removing the components, but you will get registry errors after Windows installation because the Default Account will be generated by the HKEY_CURRENT_USER Hive
which is not cleaned.
@Winterstorm , you should try this yourself and compare it. Make an ISO with Winreducer and remove everything. Install the Windows and check with CCleaner, Glary Utilities and Wise Registry Cleaner. Now use the same slimmed down Windows ISO and follow this tutorial. Install the new cleaned Windows and run the 3 cleaners and you will see . Maybe you could somehow clean the whole registry to make Winreducer even better.Please leave some feedback, cheers!!
P.S Shout-out and credits to Parapher for introducing me Sysprep