Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :FilePath-Goto
- set /p "FilePath=Please enter the full path name of Your Windows Image (.wim, .esd, .swm): "
- for /f "delims=" %%a in ("%FilePath%") do set "Extension=%%~xa"
- if /i "%Extension%"==".wim" (goto image-wim)
- if /i "%Extension%"==".esd" (goto image-esd)
- if /i "%Extension%"==".swm" (goto image-swm) else (echo "Selected Image is invalid!" && goto FilePath-Goto)
- :image-wim
- DISM.exe /Get-WimInfo /WimFile:"%FilePath%" >Wininfo.txt && Wininfo.txt
- set /p "WinIndex1=Please enter the Index Number of Edition: "
- :Apply-Dir-Goto
- set /p "Apply-Dir1=Please enter the full path name of Your Apply Directory (Not C:\, Example: X:\): "
- cls
- if /i "%Apply-Dir1%"=="C:" (echo "C: It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto1)
- if /i "%Apply-Dir1%"=="c:" (echo "C: It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto1)
- if /i "%Apply-Dir1%"=="C:\" (echo "C:\ It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto1)
- if /i "%Apply-Dir1%"=="c:\" (echo "C:\ It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto1)
- set /p "BootMode1=Select Boot Mode (UEFI, BIOS, ALL): "
- cls
- if /i "%BootMode1%"=="BIOS" (set bootmd1=BIOS)
- if /i "%BootMode1%"=="bios" (set bootmd1=BIOS)
- if /i "%BootMode1%"=="UEFI" (set bootmd1=UEFI)
- if /i "%BootMode1%"=="uefi" (set bootmd1=UEFI)
- if /i "%BootMode1%"=="ALL" (set bootmd1=ALL)
- if /i "%BootMode1%"=="all" (set bootmd1=ALL) else (echo Boot Mode Invalid! && goto BootMode-Goto1)
- DISM.exe /Apply-Image /ImageFile:%FilePath% /Index:%WinIndex1% /ApplyDir:%Apply-Dir1%
- bcdboot %Apply-Dir1%\Windows /s %Apply-Dir1% /f %BootMode1%
- echo Complete Instalation!, Press any button to Close
- pause>nul
- exit
- :image-esd
- DISM.exe /Get-WimInfo /WimFile:"%FilePath%" >Wininfo.txt && Wininfo.txt
- set /p "WinIndex2=Please enter the Index Number of Edition: "
- :Apply-Dir-Goto
- set /p "Apply-Dir2=Please enter the full path name of Your Apply Directory (Not C:\, Example: X:\): "
- cls
- if /i "%Apply-Dir2%"=="C:" (echo "C: It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto2)
- if /i "%Apply-Dir2%"=="c:" (echo "C: It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto2)
- if /i "%Apply-Dir2%"=="C:\" (echo "C:\ It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto2)
- if /i "%Apply-Dir2%"=="c:\" (echo "C:\ It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto2)
- set /p "BootMode2=Select Boot Mode (UEFI, BIOS, ALL): "
- cls
- if /i "%BootMode2%"=="BIOS" (set bootmd2=BIOS)
- if /i "%BootMode2%"=="bios" (set bootmd2=BIOS)
- if /i "%BootMode2%"=="UEFI" (set bootmd2=UEFI)
- if /i "%BootMode2%"=="uefi" (set bootmd2=UEFI)
- if /i "%BootMode2%"=="ALL" (set bootmd2=ALL)
- if /i "%BootMode2%"=="all" (set bootmd2=ALL) else (echo Boot Mode Invalid! && goto BootMode-Goto)
- DISM.exe /Apply-Image /ImageFile:%FilePath% /Index:%WinIndex2% /ApplyDir:%Apply-Dir2%
- bcdboot %Apply-Dir2%\Windows /s %Apply-Di2r% /f %BootMode2%
- echo Complete Instalation!, Press any button to Close
- pause>nul
- exit
- :image-swm
- DISM.exe /Get-WimInfo /WimFile:"%FilePath%" >Wininfo.txt && Wininfo.txt
- set /p "WinIndex3=Please enter the Index Number of Edition: "
- :Apply-Dir-Goto3
- set /p "Apply-Dir3=Please enter the full path name of Your Apply Directory (Not C:\, Example: X:\): "
- cls
- if /i "%Apply-Dir3%"=="C:" (echo "C: It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto3)
- if /i "%Apply-Dir3%"=="c:" (echo "C: It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto3)
- if /i "%Apply-Dir3%"=="C:\" (echo "C:\ It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto3)
- if /i "%Apply-Dir3%"=="c:\" (echo "C:\ It is the system disk, it is can not be used to apply the image" && goto Apply-Dir-Goto3)
- :BootMode-Goto3
- set /p "BootMode3=Select Boot Mode (UEFI, BIOS, ALL): "
- cls
- if /i "%BootMode3%"=="BIOS" (set bootmd3=BIOS)
- if /i "%BootMode3%"=="bios" (set bootmd3=BIOS)
- if /i "%BootMode3%"=="UEFI" (set bootmd3=UEFI)
- if /i "%BootMode3%"=="uefi" (set bootmd3=UEFI)
- if /i "%BootMode3%"=="ALL" (set bootmd3=ALL)
- if /i "%BootMode3%"=="all" (set bootmd3=ALL) else (echo Boot Mode Invalid! && goto BootMode-Goto3)
- DISM.exe /Apply-Image /ImageFile:%FilePath% /Index:%WinIndex3% /ApplyDir:%Apply-Dir3%
- bcdboot %Apply-Dir3%\Windows /s %Apply-Dir3% /f %BootMode3%
- echo Complete Instalation!, Press any button to Close
- pause>nul
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement