Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- @cls
- @setlocal enableextensions enabledelayedexpansion
- @CHCP 852 >nul
- @set /A COUNTER=0
- @set "spaces= "
- @set "katalog=!cd!obrazy"
- @echo Lp. Obraz Plik
- @echo.
- for /F "tokens=*" %%G in ('dir /a-d /b /s ^"%katalog%^" ^|find /i ".wim"^') DO (call :do_set1 "%%G")
- @if "%COUNTER%"=="0" @goto end
- @goto do_set4
- :do_set1
- @set wimfile=%~1
- @set wimname=%~nx1
- @for /f "tokens=3,* delims= " %%G in ('call dism /get-wiminfo /wimfile:%wimfile% ^| find /i "index"') do (call :do_set2 "%%G")
- @goto end
- :do_set2
- @set index=%~1
- @for /f "tokens=3,* delims= " %%G in ('call dism /get-wiminfo /wimfile:%wimfile% /index:%index% ^| find /i "description"') do (call :do_set3 "%%G %%H")
- @goto end
- :do_set3
- @set /A COUNTER+=1
- @set opis=%~1
- @set "o%COUNTER%=%opis%"
- @set "i%COUNTER%=%index%"
- @set "wn%COUNTER%=%wimname%"
- @set "w%COUNTER%=%wimfile%"
- @call :formatout
- ::@echo. %COUNTER% %opis% %wimname%
- @goto end
- :do_set4
- @echo.
- @echo.
- @SET /P obraz=Kt˘ry obraz zainstalowa†?:
- @echo.
- if [!wn%obraz%!]==[] (@echo Nieprawidowy wyb˘r.) & @goto end
- @echo. Wybrano obraz "!o%obraz%!" z pliku !wn%obraz%!
- @echo.
- @SET /P wyb=Czy wyb˘r jest prawidowy (T czy N)?:
- @echo.
- @if /i [%wyb%]==[T] @goto do_set5
- @if /i [%wyb%]==[Y] @goto do_set5
- @goto end
- :formatout
- @call :padright opis 40
- @call :padright wimname 20
- @call :padright COUNTER 5
- @echo %COUNTER% %opis% %wimname%
- @goto :end
- :padright
- @call SET padded=%%%1%%%spaces%
- @call SET %1=%%padded:~0,%2%%
- @goto end
- :do_set5
- @call install.cmd !w%obraz%! !i%obraz%!
- @echo.
- @goto end
- :end
- @endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement