Run this script while in a Windows installation USB. (You can open a command prompt with Shift+F10).
You will need to have 2 drives of some kind, the one you're extracting the installation from and a drive where you're storing the actual file. The second drive needs to have a folder named "Scratch", it can both be created manually or automatically with the script.
WARNING: I made this script in like 5 minutes, I take no responsibility.