-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdism_installer.bat
66 lines (52 loc) · 1.95 KB
/
dism_installer.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
:par
echo list disk > CreatePartitions.txt
cls
echo CreatePartitions-UEFI
diskpart /s CreatePartitions.txt
echo.
echo Please enter the number of the disk to wipe and use for windows
set /p DISK=disk number:
if "%DISK%"=="" goto :eof
echo select disk %DISK% > CreatePartitions.txt
echo list disk >> CreatePartitions.txt
echo list partition >> CreatePartitions.txt
diskpart /s CreatePartitions.txt
echo.
echo The selected disk will get wiped, are you sure you selected the right one?
set /p CONF=Please confirm your selection (y/n):
if not "%CONF%"=="y" goto :par
echo.
echo select disk %DISK% > CreatePartitions.txt
echo clean >> CreatePartitions.txt
echo convert gpt >> CreatePartitions.txt
echo create partition efi size=100 >> CreatePartitions.txt
echo format quick fs=fat32 label="System" >> CreatePartitions.txt
echo assign letter="S" >> CreatePartitions.txt
echo create partition msr size=16 >> CreatePartitions.txt
echo create partition primary >> CreatePartitions.txt
echo format quick fs=ntfs label="Windows" >> CreatePartitions.txt
echo assign letter="W" >> CreatePartitions.txt
echo list volume >> CreatePartitions.txt
echo exit >> CreatePartitions.txt
diskpart /s CreatePartitions.txt
echo Searching for Images
for %%a 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 @if exist %%a:\Images\ set IMAGESDRIVE=%%a
echo The Images folder is on drive: %IMAGESDRIVE%
echo.
echo Checking Image Index
Dism /Get-ImageInfo /imagefile:%IMAGESDRIVE%:\Images\install.wim
echo.
set /p INDEX=Please enter the Index number of the desired edition:
echo The Index number set is %INDEX%
echo.
echo Applying Image to Windows partition
dism /Apply-Image /ImageFile:%IMAGESDRIVE%:\Images\install.wim /Index:%INDEX% /ApplyDir:W:\
echo.
echo Copying boot files to System partition
W:\Windows\System32\bcdboot W:\Windows /s S:
echo.
del CreatePartitions.txt
echo Installation complete. Continue to reboot.
:eof
exit