-
Notifications
You must be signed in to change notification settings - Fork 1
/
Ventoy_TR.bat
268 lines (252 loc) · 10.7 KB
/
Ventoy_TR.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
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
:: INFO:
:: GRUB2 FILE MANAGER SETUP & DOWNLOAD SUITE
:: Copyright (C) 2020 mephistooo2 | TNCTR.com
:: Grub2 File Manager USB Installer Github: https://github.com/abdullah-erturk/SecureBoot-Grub2FM-Suite
:: Ventoy Command Line Installer
:: Copyright (C) 2020 mephistooo2 | TNCTR.com
:: https://github.com/abdullah-erturk/Ventoy-Command-Line-Installer
:: Ventoy & Grub2FM Multiboot (With Original Files)
:: Copyright (C) 2020 mephistooo2 | TNCTR.com
:: Ventoy & Grub2FM Multiboot (With Original Files) Github: https://github.com/abdullah-erturk/Ventoy-Grub2FM-Multiboot-With-Original-Files
:: Ventoy Github: https://github.com/ventoy/Ventoy
:: credit: longpanda
::===============================================================================================================
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"
for /f "delims=" %%x in (Ventoy\version) do set ver=%%x >nul 2>&1
::===============================================================================================================
:MAINMENU
setlocal enableextensions disabledelayedexpansion
for /f "tokens=6 delims=[]. " %%# in ('ver') do set winbuild=%%#
del %temp%\msg.vbs /f /q >nul 2>&1
echo Set WshShell = CreateObject("WScript.Shell"^) >> %temp%\msg.vbs
echo x = WshShell.Popup ("Isletim Sistemi Windows 10 degil. Betik dosyasi sadece Windows 10 ve uzerinde calisir. 5 saniye icinde islem sonlandirilacak.",5, "..:: DIKKAT ::..") >> %temp%\msg.vbs
if %winbuild% LSS 10240 (
call %temp%\msg.vbs
del %temp%\msg.vbs /f /q >nul 2>&1
exit
)
::===============================================================================================================
mode con:cols=85 lines=45
title Ventoy MultiBoot Suite v%ver% - script made by mephistooo2 ^| TNCTR.com
:Main
cls
echo.
echo =====================================================================================
echo.
echo Ventoy MultiBoot Suite v%ver% - script made by mephistooo2 ^| TNCTR.com
echo.
echo 1 - USB/HDD D˜SK B™LšMšNE Ventoy KUR
echo.
echo 2 - VENTOY GšNCELLE
echo.
echo 3 - VENTOY GITHUB SAYFALARINI Z˜YARET ED˜N
echo.
echo 4 - €IKIž
echo.
echo =====================================================================================
echo.
choice /c 1234 /cs /n /m "Se‡iminizi Yapn : "
echo.
if errorlevel 4 Exit
if errorlevel 3 goto :TNCTR
if errorlevel 2 goto :Update
if errorlevel 1 goto :Ventoy
echo.
::===============================================================================================================
:Ventoy
call :MsgBox "Ventoy Komut Destekli kurulumda eger hata olusursa hata uyarilari gorunmeyecektir. \n \nBu nedenle bir hata ile karsilasirsaniz Ventoy log dosyalarini inceleyin. " "VBInformation" "..:: UYARI ::.."
echo. [T]ahribatsz Kurulum [F]ormatl Kurulum
echo.
set dest=0
choice /C:TF /N /M "Ventoy kurulumunun nasl yaplmasn istersiniz? : "
if errorlevel 2 goto :Destructive
if errorlevel 1 set dest=1
if errorlevel 1 goto :Non-Destructive
::===============================================================================================================
:Destructive
echo.
set style=
echo. [G]PT [M]BR
echo.
choice /C:GM /N /M "Ventoy kurulumu yaplacak diskin yapsn se‡in : "
if errorlevel 1 set style=GPT
if errorlevel 2 set style=MBR
echo.
set diskstr=
echo. [1] NTFS [2] FAT32 [3] exFAT [4] UDF
echo.
choice /C:4321 /N /M "Ventoy kurulumu sonras diskin depolama alan i‡in b”lm yapsn se‡in : "
if errorlevel 1 set diskstr=UDF
if errorlevel 2 set diskstr=exFAT
if errorlevel 3 set diskstr=FAT32
if errorlevel 4 set diskstr=NTFS
::===============================================================================================================
:ask
echo.
set free=0
echo. [E]VET [H]AYIR
echo.
choice /C:EH /N /M "Ventoy kurulumu sonras diskin sonunda ayrlmŸ alan brakmak ister misiniz? : "
if errorlevel 2 goto :VentoyInstall
if errorlevel 1 set free=1
if errorlevel 1 goto :free
::===============================================================================================================
:free
echo.
set /p "disksize=˜stediginiz miktarda boyutu MB cinsinden yazn: " || goto :free
setlocal enabledelayedexpansion
for /f "delims=0123456789" %%a in ("!disksize!") do set "disksize="
endlocal & set "disksize=%disksize%"
if not defined disksize (
echo.
echo Ltfen sadece rakam kullann...
timeout /t 2 > nul
goto :free
)
set value=40
If %disksize% GEQ %value% (
GOTO :VentoyInstall
) else (
echo.
echo AyrlmŸ alan boyutunu EN AZ 40 MB olarak girin...
timeout /t 2 > nul
goto :free
)
::===============================================================================================================
:VentoyInstall
call :showDiskTable
set /p " diskNumber=Ventoy yklenecek disk numarasn yazn: "
echo.
echo Ltfen bekleyin...
echo.
if %free% equ 1 (
Ventoy2Disk.exe VTOYCLI /I /PhyDrive:%diskNumber% /NOUSBCheck /%style% /FS:%diskstr% /R:%disksize%
goto :freespaceformat
) else (
Ventoy2Disk.exe VTOYCLI /I /PhyDrive:%diskNumber% /NOUSBCheck /%style% /FS:%diskstr%
goto :end
)
::===============================================================================================================
:freespaceformat
set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
> "%scriptFile%" (
echo RESCAN
)
type "%scriptFile%" >nul
diskpart /s "%scriptFile%" >nul
del /q "%scriptFile%" >nul
echo. [E]VET [H]AYIR
echo.
choice /C:EH /N /M "Disk sonunda ayrlmŸ alan bi‡imlendirmek ister misiniz? : "
if errorlevel 2 goto :end
if errorlevel 1 goto :yes
::===============================================================================================================
:yes
echo.
echo. [1] NTFS [2] FAT32 [3] exFAT [4] UDF
echo.
choice /C:4321 /N /M "Disk sonunda ayrlmŸ alan bi‡imlendirmek i‡in bir b”lm yapsn se‡in : "
if errorlevel 1 set diskstr=UDF
if errorlevel 2 set diskstr=exFAT
if errorlevel 3 set diskstr=FAT32
if errorlevel 4 set diskstr=NTFS
call :DriveLetter
set "label=Ventoy"
set q1= $Q1=(gwmi Win32_Volume -filter $('Label='+[char]34+$env:label+[char]34)).DeviceID
set q2= $Q2=(gwmi MSFT_Partition -Namespace root\Microsoft\Windows\Storage ^|where {$_.AccessPaths -contains $Q1}).DiskNumber
for /f %%s in ('powershell -nop -c "%q1%; if ($Q1) {%q2%; $Q2}"') do set disk=%%s
set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
> "%scriptFile%" (
echo LIST DISK
echo SELECT DISK %disk%
echo CREATE PARTITION PRIMARY
echo FORMAT QUICK FS=%diskstr% LABEL="Free Space"
echo ASSIGN LETTER=%driveletter%
)
type "%scriptFile%" >nul
echo.
echo Diskin boŸ alan bi‡imlendiriliyor...
diskpart /s "%scriptFile%" >nul
del /q "%scriptFile%" >nul
echo.
)
goto :end
::===============================================================================================================
:Non-Destructive
call :MsgBox "Tahribatsiz Kurulum seceneginde Ventoy kurulacak disk kesinlikle NTFS formatinda olmalidir." "VBInformation" "..:: DIKKAT ::.."
echo.
call :showDiskTable
set /p " diskNumber=Ventoy Tahribatsz Kurulum yaplacak disk numarasn yazn : "
echo.
echo Ltfen bekleyin...
Ventoy2Disk.exe VTOYCLI /I /PhyDrive:%diskNumber% /NonDest /NOUSBCheck
set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
> "%scriptFile%" (
echo RESCAN
)
type "%scriptFile%" >nul
diskpart /s "%scriptFile%" >nul
del /q "%scriptFile%" >nul
goto :end
::===============================================================================================================
:end
set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
> "%scriptFile%" (
echo RESCAN
)
type "%scriptFile%" >nul
diskpart /s "%scriptFile%" >nul
del /q "%scriptFile%" >nul
echo.
echo ˜žLEM TAMAMLANDI
echo.
call :MsgBox "Ventoy MultiBoot kurulumu tamamlandi." "VBInformation" ".:: Ventoy MultiBoot ::."
choice /C:AX /N /M "ANA MENš i‡in A -- €IKIž i‡in X tusuna basn : "
if errorlevel 2 Exit
if errorlevel 1 goto :Main
::===============================================================================================================
:Update
call :MsgBox "Ventoy Komut Destekli kurulumda eger hata olusursa hata uyarilari gorunmeyecektir. \n \nBu nedenle bir hata ile karsilasirsaniz Ventoy log dosyalarini inceleyin. " "VBInformation" "..:: UYARI ::.."
call :MsgBox "Bu bolumu diskinizde zaten \n \nVentoy \n \nvarsa kullanmalisiniz." "VBInformation" "..:: DIKKAT ::.."
call :showDiskTable
echo.
set /p " diskNumber=Ventoy ykl diskinizi se‡in : "
echo.
echo Ltfen bekleyin...
Ventoy2Disk.exe VTOYCLI /U /PhyDrive:%diskNumber% /NOUSBCheck
echo.
echo ˜žLEM TAMAMLANDI
echo.
choice /C:AX /N /M "ANA MENš i‡in A -- €IKIž i‡in X tusuna basn : "
if errorlevel 2 Exit
if errorlevel 1 goto :Main
::===============================================================================================================
:showDiskTable
echo ======================================================
echo D˜KKAT : DO¦RU D˜SK˜ SE€T˜¦˜N˜ZDEN EM˜N OLUN !!!
echo.
echo list disk | diskpart | findstr /b /c:" "
echo ======================================================
goto :eof
::===============================================================================================================
:DriveLetter
set "driveletter="
for %%a in (Z Y X W V U T S R Q P O N M L K J I H G F E D C) do cd %%a: 1>>nul 2>&1 & if errorlevel 1 set driveletter=%%a
exit /b 0
::===============================================================================================================
:MsgBox
Rem 64=vbInformation, 48=vbExclamation, 16=vbCritical 32=vbQuestion
setlocal enableextensions
set "tempFile=%temp%\%~nx0.%random%%random%%random%vbs.tmp"
>"%tempFile%" echo(WScript.Quit MsgBox(Replace("%~1","\n",vbcrlf),%~2,"%~3") & cscript //nologo //e:vbscript "%tempFile%"
set "exitCode=%errorlevel%" & del "%tempFile%" >nul 2>nul
endlocal & exit /b %exitCode%
::===============================================================================================================
:TNCTR
start https://www.tnctr.com/topic/1216460-ventoy-komut-kurulumu-betik-dosyas%C4%B1/
start https://github.com/abdullah-erturk/Ventoy-Command-Line-Installer
start https://github.com/ventoy/Ventoy/releases
goto Main
::===============================================================================================================