@echo off
setlocal enabledelayedexpansion
SET DD=efi
SET MM=Paravis
SET SS=Windows
SET IN=NI
for %%I in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
set IP=%%I:\!DD!\!MM!\!SS!
dir /d !IP!\install_7_x64.wim&&set IN=!IP!\install_7_x64.wim
dir /d !IP!\install_7_x64.esd&&set IN=!IP!\install_7_x64.esd
dir /d !IP!\install_7_x64.swm&&set IN=!IP!\install_7_x64.swm
dir /d !IP!\install_7_x64.rg&&set IN=!IP!\install_7_x64.rg
IF !IN! NEQ NI goto :INST
)
IF %IN% EQU NI (
%Temp%\Win_Installer\no7x64.exe
:QUIT
exit
)
goto:RBT
:INST
echo %IP%
if exist X:\sources\unattend.xml SET UN=/unattend:X:\sources\unattend.xml
if exist %IP%\unattend7x64.xml SET UN=/unattend:%IP%\unattend7x64.xml
if exist %IP%\_unattend7x64.xml SET UN=/unattend:%IP%\_unattend7x64.xml
if exist %IP%\OEM7x64\nul SET OEM=/m:%IP%\OEM7x64
if exist %IP%\$OEM7x64$\nul SET OEM=/m:%IP%\$OEM7x64$
set ST=%SystemDrive%\Sources\Setup.exe
if exist %IP%\Setup.exe set ST=%IP%\Setup.exe
if not exist %ST% goto :BAD
cd /d %IP%
%ST% /installfrom:%IN% %OEM% %UN%
goto :RBT
:BAD
dir X:\ /b
echo Cannot find %ST% !
echo.
:RBT
exit
@echo Press a key to reboot now...
pause
wpeutil reboot
pause

:QUIT
exit