Great article...thanks for the time and effort....wanted to mention an issue I discovered....its regarding the following section (32/64):
echo "Updating required PATH environment variables"
reg load HKLM\1 c:\winpe_amd64\mount\Windows\System32\config\system
reg add "HKLM\1\ControlSet001\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /d %%SystemRoot%%\system32;%%SystemRoot%%;%%SystemRoot%%\System32\Wbem;%%SystemDrive%%\cba8;%%SystemDrive%%\ldclient;%%SystemRoot%%\System32\WindowsPowerShell\v1.0\ /f
reg unload HKLM\1
For the REG_EXPAND_SZ key type, use the caret symbol ( ^ ) with %" inside the /d parameter otherwise your path will reference C instead of X as an example... (REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d ^%systemroot^% )