@echo off
SetLocal enabledelayedexpansion
title repack_SamDrivers

:e
echo Перепаковка драйверов под нужную ось
echo.
echo 1. Windows XP x86
echo 2. Windows XP x64
echo 3. Windows 7  x86
echo 4. Windows 7  x64
echo 5. Windows 8  x86
echo 6. Windows 8  x64
echo.

set /p n="Укажите цифру вашего выбора: "
echo.
if "%n%"=="1" set oss=WinXP_x86& set pr="5x64" "6x64" "6x86" "7x64" "7x86" "8x64" "8x86" "NTx86" "NTx64" "AllNT" "All6" "All7" "All8" "Allx64"& goto :r
if "%n%"=="2" set oss=WinXP_x64& set pr="5x86" "6x64" "6x86" "7x64" "7x86" "8x64" "8x86" "NTx86" "NTx64" "AllNT" "All6" "All7" "All8" "Allx86"& goto :r
if "%n%"=="3" set oss=Win7_x86& set pr="5x64" "5x86" "6x64" "6x86" "7x64" "8x64" "8x86" "AllXP" "NTx64" "All6" "All8" "Allx64"& goto :r
if "%n%"=="4" set oss=Win7_x64& set pr="5x64" "5x86" "6x64" "6x86" "7x86" "8x64" "8x86" "AllXP" "NTx86" "All6" "All8" "Allx86"& goto :r
if "%n%"=="5" set oss=Win8_x86& set pr="5x64" "5x86" "6x64" "6x86" "7x86" "7x64" "8x64" "AllXP" "NTx64" "All6" "All7" "Allx64"& goto :r
if "%n%"=="6" set oss=Win8_x64& set pr="5x64" "5x86" "6x64" "6x86" "7x86" "7x64" "8x86" "AllXP" "NTx86" "All6" "All7" "Allx86"& goto :r
cls& goto :e
echo.

:r
md %oss%
For /f "delims=" %%a In ('Dir /b/on "*.7z"') Do copy /y "%%a" "%oss%\" >nul
for /f "delims=" %%b in ('Dir /b "%oss%\*.7z"') do (
	7za.exe d "%oss%\%%b" %pr% -r >nul
	echo %%~nxb	обработан и упакован
		)
	
echo.
echo Обработка завершена ^^!
pause
exit /b


