This repository was archived by the owner on Jan 25, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
271 lines (221 loc) · 5.34 KB
/
Copy pathsetup.bat
File metadata and controls
271 lines (221 loc) · 5.34 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
@echo off
chcp 65001
color 02
set colornum="1"
set wdir=%~dp0
set swdir=%~dp0
cd %wdir%
:menu
set "opti="
title CONSOLE SETUP
cls
echo.
echo .:^|^|^|^|^| CONSOLE SETUP ^|^|^|^|^|:.
echo _________ by catmpeg _________
echo Time on start: %time%
echo ------------------------------
echo 1. Install Windows
echo 2. See Indexes From WIM,ESD File
echo 3. Open Cmd
echo 4. Open Notepad
echo 5. Change Working Directory
echo 6. Open Diskpart
echo 7. Change color
echo 8. Exit
echo ------------------------------
echo Working directory = "%wdir%"
echo Sources Working directory = "%swdir%"
echo ------------------------------
echo.
set /p opti="Option: "
if "%opti%"=="1" goto installw
if "%opti%"=="2" goto seeind
if "%opti%"=="3" goto shell
if "%opti%"=="4" goto notepad
if "%opti%"=="5" goto chwkdir
if "%opti%"=="6" goto opendiskpart
if "%opti%"=="7" goto chcolor
if "%opti%"=="8" color & cls & exit /b
echo Invalid Option!
timeout 1 >nul
goto menu
:installw
cd %wdir%
cls
echo list disk > listdisk.txt
echo exit >> listdisk.txt
diskpart /s listdisk.txt
del listdisk.txt
set /p disknumber="Disk Number: "
title writing diskpart.txt
echo sel disk %disknumber% > diskpart.txt
echo clean >> diskpart.txt
echo convert gpt >> diskpart.txt
echo create part EFI size=100 >> diskpart.txt
echo format fs=fat32 quick >> diskpart.txt
echo assign letter=s >> diskpart.txt
echo create part msr size=16 >> diskpart.txt
echo create part prim >> diskpart.txt
echo shrink minimum=500 >> diskpart.txt
echo format fs=ntfs quick label="Windows" >> diskpart.txt
echo assign letter=w >> diskpart.txt
echo create part prim >> diskpart.txt
echo format quick fs=ntfs label="Recovery" >> diskpart.txt
echo assign letter=R >> diskpart.txt
echo set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" >> diskpart.txt
echo gpt attributes=0x8000000000000001 >> diskpart.txt
echo list vol >> diskpart.txt
echo exit >> diskpart.txt
title running diskpart
diskpart /s diskpart.txt
del diskpart.txt
title windows extraction
cd /d "%swdir%\sources" 2>nul || (
echo Error: Sources folder in "%swdir%" not found!
pause >nul
goto menu
)
echo.
echo Available WIM/ESD files in "%swdir%\sources":
dir /b *.wim 2>nul || echo No WIM files found.
dir /b *.esd 2>nul || echo No ESD files found.
echo.
:retry_wim_select
set "wimesdfilesetup="
set /p "wimesdfilesetup=Enter WIM or ESD filename: "
if "%wimesdfilesetup%"=="" (
echo Error: Filename cannot be empty!
goto retry_wim_select
)
if not exist "%wimesdfilesetup%" (
echo Error: File "%wimesdfilesetup%" not found!
goto retry_wim_select
)
echo Starting Extraction...
dism /get-wiminfo /wimfile:"%wimesdfilesetup%"
:get_index
set "indexwim="
set /p "indexwim=Enter image index: "
if "%indexwim%"=="" (
echo Error: Index cannot be empty!
goto get_index
)
title running dism
dism /apply-image /imagefile:%wimesdfilesetup% /index:%indexwim% /applydir:w:\
title running bcdboot
bcdboot w:\Windows /s s: /f UEFI
cd ..
title installation completed
echo Windows Installed! Press any key to reboot...
pause >nul
wpeutil reboot
exit
:seeind
cls
cd %wdir%
cd /d "%swdir%\sources" 2>nul || (
echo Error: Sources folder in "%swdir%" not found!
pause
goto menu
)
echo.
echo Available WIM/ESD files in "%swdir%\sources":
dir /b *.wim 2>nul || echo No WIM files found.
dir /b *.esd 2>nul || echo No ESD files found.
echo.
:retry_seeind
set "wimesdfile="
set /p "wimesdfile=Enter WIM or ESD filename (exit to exit): "
if "%wimesdfile%"=="" (
echo Error: Filename cannot be empty!
goto retry_seeind
)
if "%wimesdfile%"=="exit" (
goto menu
)
if not exist "%wimesdfile%" (
echo Error: File "%wimesdfile%" not found!
goto retry_seeind
)
dism /get-wiminfo /wimfile:"%wimesdfile%"
cd %wdir%
pause >nul
goto menu
:shell
title cmd
color 07
cls
echo Run exit to exit from cmd
ver
echo.
cmd /k
goto menu
:opendiskpart
cls
diskpart
goto menu
:notepad
start notepad
goto menu
:chwkdir
cls
echo Currently working dir = "%wdir%"
set /p "newwkdir=Enter new working directory (Full path) (exit to exit) (skip to skip): "
if "%newwkdir%"=="" (
echo Error: Working dir path cannot be empty!
goto chwkdir
)
if "%newwkdir%"=="exit" (
goto menu
)
if "%newwkdir%"=="skip" (
goto chswkdir
)
set wdir=%newwkdir%
echo Now working dir = "%wdir%"
:chswkdir
set /p "newswkdir=Set new working directory for sources? (Full path to directory where folder "sources" located) (no to exit): "
if "%newswkdir%"=="" (
echo Error: Working dir path for sources cannot be empty!
goto chswkdir
)
if "%newswkdir%"=="no" (
goto menu
)
set swdir=%newswkdir%
echo Now source working dir = "%swdir%"
goto menu
:chcolor
if not defined colornum set colornum=1
if %colornum% equ 1 (
color 05
set colornum=2
goto menu
)
if %colornum% equ 2 (
color 65
set colornum=3
goto menu
)
if %colornum% equ 3 (
color 87
set colornum=4
goto menu
)
if %colornum% equ 4 (
color 57
set colornum=5
goto menu
)
if %colornum% equ 5 (
color 08
set colornum=6
goto menu
)
if %colornum% equ 6 (
color 02
set colornum=1
goto menu
)
set colornum=1
goto chcolor