Hello everyone,
To run sysprep in windows os 10 or 11 , check for windows update and if you get message You're up to date then navigate to C:\windows\system32\sysprep and then right click sysprep application file to run as administraror
Then check Generalize in OOBE and select shutdown in System Prepartation Tool 3.14 box .
If errors like app removal error, fatal error or unable to validate current windows installation occurs , then I resolved these errors by following steps:-
(A) See the error regarding with app removal in c:\windows\system32\sysprep\panther\setuperr text file and type commands similar to following examples:-
{Error to remove application followed by application name is to be noted.}
Commands are shown as an example if errors are occured while removing these applications.
Get-AppxPackage -allusers AdobeNotificationClient_3.0.1.1_x86__enpm4xejd91yc | Remove-AppxPackage
Get-AppxPackage -allusers AdobeNotificationClient | Remove-AppxPackage -AllUsers
Get-AppxPackage -allusers "Microsoft.BIngSunshine" | Remove-AppxPackage -AllUsers
Get-AppxPackage -allusers "312588en48.BasicPhotoviewer_3.7.2.0._x64_2c5bccghv4cc2 | Remove-AppxPackage
Get-AppxPackage -allusers "312588en48.BasicPhotoviewer | Remove-AppxPackage -AllUsers
Your computer may show different error messages regarding with applications installed in your pc.
(B) Following changes in registry make sysprep to run without errors.
Run Regedit as administrator , then navigate to the paths :-
1. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform
Right click SkipRearm , click modify, and change value data to 1.
2. HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus
Right click GeneralizationState >modify, change value data 7. In the same pane, if CleanupState key is not present then
right click New> DWORD(32-bit) Value >CleanupState right click modify change value data to 2.
(C) Run cmd as administrator
c:\windows\system32 > msdtc -uninstall
c:\windows\system32 >msdtc -install
(D). Then run powershell as administrator and type:-
PS C:\windows\system32>Get-AppxPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
Please note colours of the words shown may appear different but highlighted with colour in powershell.(In my pc in powershell , it appeared yellow and symbol $ inside bracket of green colour.)
After shutdown, boot from bootable usb of windows 11.
Select > repair >troubleshoot>command prompt
x:\sources>c:
c:>dir
if windows is located on C: then run following command to capture install.wim of current windows.
c:\>dism /capture-image /imagefile:X:\install.wim /capturedir:C:\ /name:win_11
(change letters according to your windows installation directory , and destination location to save install.wim )
Place this captured install.wim in bootable usb prepared by media creation tool which has install.esd . You get up to date custom bootable usb of windows 11. ( When booted install.wim runs first ,not install.esd)
Now when you boot normally from hard disk/ssd wherefrom we have run sysprep, you have to set some windows installtion settings as if new installation goes on.
Have an error free up to date install.wim (captured) of current windows 11 operating system. To add, when installed on any other partition, the data inside C: drive/partition is also copied to the destination drive/partition as it is capured by dism /capture-image command.
Thanks for reading.