Kendim için bir bat dosyası hazırlamıştım, bunu da paylaşayım belki içinize yarar.
Kod:
@echo off
:Top
echo What do you want?
echo.
echo For capture system image to press 1
echo For restore system from image to press 2
echo Press e to exit
echo.
echo.
:Ask
set INPUT=
set /P INPUT=Type 1 or 2 or E: %=%
If /I "%INPUT%"=="1" goto capture
If /I "%INPUT%"=="2" goto restore
If /I "%INPUT%"=="e" goto end
echo Incorrect input
echo.
goto Ask
:capture
cls
echo Where you gonna save system recovery image?
echo.
fsutil fsinfo drives
set /p UserInputLetter= Set backup drive letter :
set /p UserInputName= Give a name to your backup image :
echo.
cls
echo Your Backup image gonna save: %UserInputLetter%:/%UserInputName%/%UserInputName%.wim
echo Do you want to continue? Y or N
set INPUT=
set /P INPUT=%=%
If /I "%INPUT%"=="y" goto REC
If /I "%INPUT%"=="n" goto capture
If /I "%INPUT%"=="e" goto end
:REC
cls
recimg -CreateImage %UserInputLetter%:/%UserInputName%
pause
goto Top
:restore
cls
FOR /F "tokens=*" %%G IN ('dir /s/b *.wim') DO (
echo.
echo.
SET wimfile=%%G
)
echo Do you want restore this image? %wimfile%
set INPUT=
set /P INPUT=Y or N: %=%
If /I "%INPUT%"=="y" goto restoreimage
If /I "%INPUT%"=="n" goto top
If /I "%INPUT%"=="e" goto end
echo Incorrect input
goto restore
:restoreimage
cls
dism /Apply-Image /ImageFile:%wimfile% /index:1 /ApplyDir:C:\
pause
goto top
:end
