ESD to WIM

1. Open Command Prompt with Admin

2. Change directory to c: root where you should of copied install.esd. to change directory type cd .. and press enter and then again cd .. and press enter.

3. Type: dism /Get-WimInfo /WimFile:install.esd and press enter

4. Type: dism /export-image /SourceImageFile:install.esd /SourceIndex:5 /DestinationImageFile:C:\Temp\21H2\Mount\install.wim /Compress:max /CheckIntegrity

5. that's it, you should now have install.wim in your c:\

6. dism /export-image /SourceImageFile:"C:\Temp\21H2\Mount\install.wim" /SourceIndex:1 /DestinationImageFile:"C:\Temp\21H2\ESD\install.esd" /Compress:recovery /CheckIntegrity
dism /Get-WimInfo /WimFile:C:\Temp\Windows\21H2\sources\install.esd
dism /export-image /SourceImageFile:C:\Temp\Windows\21H2\sources\install.esd /SourceIndex:5 /DestinationImageFile:C:\Temp\Windows\WIM\install.wim /Compress:max /CheckIntegrity
Dism /Mount-Image /ImageFile:C:\Temp\Windows\WIM\install.wim /Index:1 /MountDir:C:\Temp\Windows\Mount
dism /Image:C:\Temp\Windows\Mount /Add-Driver /Driver:C:\Temp\21H2\Drivers /Recurse
dism /Unmount-Image /MountDir:C:\Temp\Windows\Mount /Commit
dism /export-image /SourceImageFile:"C:\Temp\Windows\WIM\install.wim" /SourceIndex:1 /DestinationImageFile:"C:\Temp\Windows\ESD\install.esd" /Compress:recovery /CheckIntegrity