copy install.esd from a windows iso or cd to some directory, the files are located under Sources
open command promt with administrative rights and open the directory where you copied the files
to get a list of supported installations type
dism /Get-WimInfo /WimFile:install.esd
below you can see the command used to create a .WIM installation file from install.esd, change the SourceIndex to the installation you want to install from the list you got with the previous command
dism /export-image /SourceImageFile:install.esd /SourceIndex:6 /DestinationImageFile:install.wim /Compress:max /CheckIntegrity