-
Notifications
You must be signed in to change notification settings - Fork 1
/
Office-Legal-Activation-Script-Menusuz-v1.0.bat
383 lines (295 loc) · 17.5 KB
/
Office-Legal-Activation-Script-Menusuz-v1.0.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
:: Office Aktivasyon Arac
:: Written by @BoomBookTR
:: https://github.com/BoomBookTR/Office-Legal-Activation-Script
:: Lisans Anahtar Telegram Kanalmz: https://t.me/windows_office_etkinlestir
@echo off
setlocal EnableDelayedExpansion
::net file to test privileges, 1>NUL redirects output, 2>NUL redirects errors
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto START ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' ( goto START )
set "batchPath=%~f0"
set "batchArgs=ELEV"
::Add quotes to the batch path, if needed
set "script=%0"
set script=%script:"=%
IF '%0'=='!script!' ( GOTO PathQuotesDone )
set "batchPath=""%batchPath%"""
:PathQuotesDone
::Add quotes to the arguments, if needed.
:ArgLoop
IF '%1'=='' ( GOTO EndArgLoop ) else ( GOTO AddArg )
:AddArg
set "arg=%1"
set arg=%arg:"=%
IF '%1'=='!arg!' ( GOTO NoQuotes )
set "batchArgs=%batchArgs% "%1""
GOTO QuotesDone
:NoQuotes
set "batchArgs=%batchArgs% %1"
:QuotesDone
shift
GOTO ArgLoop
:EndArgLoop
::Create and run the vb script to elevate the batch file
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
echo UAC.ShellExecute "cmd", "/c ""!batchPath! !batchArgs!""", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B
:START
::Remove the elevation tag and set the correct working directory
IF '%1'=='ELEV' ( shift /1 )
cd /d %~dp0
:: .... your code start ....
@echo off
setlocal
call :setESC
cls
:: color help <<<<<<<<<<<<<<<<<<btn renk bilgileri i‡in cmd ekranna yaz
:: color [arkaplanrengi][yazrengi]
::color 1F
mode con lines=20 cols=150
:: Global options for ospp.vbs
:: https://docs.microsoft.com/en-us/deployoffice/vlactivation/tools-to-manage-volume-activation-of-office
::Product ID
::https://docs.microsoft.com/en-us/microsoft-365/troubleshoot/installation/product-ids-supported-office-deployment-click-to-run
title Office 2013-2016-2019-2021 EtkinleŸtirme Scripti (Mensz)
echo ============================================================================&
echo ============================================================================&
echo %ESC%[101;93m #Proje: Sadece Lisans Kodunu girerek otomatik aktivasyon iŸlemi sa§lanr. %ESC%[0m&
echo %ESC%[101;93mNot: Bu script sadece var olan lisans anahtarnz sisteme cmd zerinden iŸlenmesini ve sistemin aktivasyonunu sa§lar.%ESC%[0m
echo %ESC%[101;93mKsaca KMS vb. lisans anahtar girmez vb. iŸlemler yrtmez.%ESC%[0m
echo.&
echo.&
echo Written by %ESC%[101;93m@BoomBookTR%ESC%[0m
echo.&
echo https://github.com/BoomBookTR/Office-Legal-Activation-Script
echo.&
echo Telegram Kanal: https://t.me/windows_office_etkinlestir
echo Telegram Grubu: https://t.me/windows_office_etkinlestirme
echo.&
echo.&
echo ************************************&
echo ************************************&
echo %ESC%[104m #Desteklenen rnler: %ESC%[0m&
echo ============================================================================&
echo %ESC%[93m Office 2013 %ESC%[0m&
echo %ESC%[93m Office 2016 %ESC%[0m&
echo %ESC%[93m Office 2019 %ESC%[0m&
echo %ESC%[93m Office 2021 %ESC%[0m&
echo.&
echo.&
echo ============================================================================&
:baslangic
:convert
set /P j=%ESC%[7mRetail to VL%ESC%[0m (%ESC%[92mV%ESC%[0m) //// %ESC%[7mVL to Retail%ESC%[0m (%ESC%[92mR%ESC%[0m) //// %ESC%[7mAtla%ESC%[0m (%ESC%[92mA%ESC%[0m) -----------%ESC%[101;93mSE€%ESC%[0m---------[%ESC%[92mV%ESC%[0m/%ESC%[92mR%ESC%[0m/%ESC%[92mA%ESC%[0m]?
if /I "%j%" EQU "V" goto :Retail2VL
if /I "%j%" EQU "R" goto :VL2Retail
if /I "%j%" EQU "A" goto :devamet
goto :convert
echo ============================================================================&
:Retail2VL
if exist "C:\Program Files\Microsoft Office\Office16\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office16"
if exist "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office16"
if exist "C:\Program Files\Microsoft Office\Office15\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office15"
if exist "C:\Program Files (x86)\Microsoft Office\Office15\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office15"
if exist "C:\Program Files\Microsoft Office\Office14\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office14"
if exist "C:\Program Files (x86)\Microsoft Office\Office14\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office14"
::for %%a in (4,5,6) do (if exist "%ProgramFiles%\Microsoft Office\Office1%%a\ospp.vbs" (cd "%ProgramFiles%\Microsoft Office\Office1%%a")
::if exist "%ProgramFiles(x86)%\Microsoft Office\Office1%%a\ospp.vbs" (cd "%ProgramFiles(x86)%\Microsoft Office\Office1%%a"))
echo ============================================================================&
echo ============================================================================&
echo ============================================================================&
echo ============================================================================&
echo ============================================================================&
echo ============================================================================&
set /P d=%ESC%[93mRetail to Volume (VL) iŸlemi i‡in srm se‡iniz:%ESC%[0m %ESC%[7m2013%ESC%[0m (%ESC%[92m1%ESC%[0m) //// %ESC%[7m2016%ESC%[0m (%ESC%[92m2%ESC%[0m) //// %ESC%[7m2019%ESC%[0m (%ESC%[92m3%ESC%[0m) //// %ESC%[7m2021%ESC%[0m (%ESC%[92m4%ESC%[0m) //// %ESC%[7mATLA%ESC%[0m (%ESC%[92mA%ESC%[0m) i‡in srasyla [%ESC%[92m1%ESC%[0m/%ESC%[92m2%ESC%[0m/%ESC%[92m3%ESC%[0m/%ESC%[92m4%ESC%[0m/%ESC%[92mA%ESC%[0m] tkla?
if /I "%d%" EQU "1" goto :retailtovolume2013
if /I "%d%" EQU "2" goto :retailtovolume2016
if /I "%d%" EQU "3" goto :retailtovolume2019
if /I "%d%" EQU "4" goto :retailtovolume2021
if /I "%d%" EQU "A" goto :devamet
goto :Retail2VL
:retailtovolume2013
for /f %%x in ('dir /b "..\..\Microsoft Office 15\root\Licenses\"ProPlusVL*.xrm-ms') do cscript ospp.vbs /inslic:"..\..\Microsoft Office 15\root\Licenses\%%x"
goto :devamet
:retailtovolume2016
for /f %%x in ('dir /b "..\root\Licenses16\"ProPlusVL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x"
goto :devamet
:retailtovolume2019
for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x"
goto :devamet
:retailtovolume2021
for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2021VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x"
goto :devamet
echo ============================================================================&
:VL2Retail
if exist "C:\Program Files\Microsoft Office\Office16\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office16"
if exist "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office16"
if exist "C:\Program Files\Microsoft Office\Office15\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office15"
if exist "C:\Program Files (x86)\Microsoft Office\Office15\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office15"
if exist "C:\Program Files\Microsoft Office\Office14\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office14"
if exist "C:\Program Files (x86)\Microsoft Office\Office14\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office14"
::for %%a in (4,5,6) do (if exist "%ProgramFiles%\Microsoft Office\Office1%%a\ospp.vbs" (cd "%ProgramFiles%\Microsoft Office\Office1%%a")
::if exist "%ProgramFiles(x86)%\Microsoft Office\Office1%%a\ospp.vbs" (cd "%ProgramFiles(x86)%\Microsoft Office\Office1%%a"))
set /P d= %ESC%[93mVolume to Retail (R) iŸlemi i‡in srm se‡iniz:%ESC%[0m %ESC%[7m2013%ESC%[0m (%ESC%[92m1%ESC%[0m) //// %ESC%[7m2016%ESC%[0m (%ESC%[92m2%ESC%[0m) //// %ESC%[7m2019%ESC%[0m (%ESC%[92m3%ESC%[0m) //// %ESC%[7m2021%ESC%[0m (%ESC%[92m4%ESC%[0m) //// %ESC%[7mATLA%ESC%[0m (%ESC%[92mA%ESC%[0m) i‡in srasyla [%ESC%[92m1%ESC%[0m/%ESC%[92m2%ESC%[0m/%ESC%[92m3%ESC%[0m/%ESC%[92m4%ESC%[0m/%ESC%[92mA%ESC%[0m] tkla?
if /I "%d%" EQU "1" goto :volumetoretail2013
if /I "%d%" EQU "2" goto :volumetoretail2016
if /I "%d%" EQU "3" goto :volumetoretail2019
if /I "%d%" EQU "4" goto :volumetoretail2021
if /I "%d%" EQU "A" goto :devamet
goto :VL2Retail
:volumetoretail2013
for /f %%x in ('dir /b "..\..\Microsoft Office 15\root\Licenses\"ProPlus*R_Retail*.xrm-ms') do cscript ospp.vbs /inslic:"..\..\Microsoft Office 15\root\Licenses\%%x"
goto :devamet
:volumetoretail2016
for /f %%x in ('dir /b "..\root\Licenses16\"ProPlus*R_Retail*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x"
goto :baslangic
:volumetoretail2019
for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019*R_Retail*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x"
goto :baslangic
:volumetoretail2021
for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2021*R_Retail*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x"
goto :baslangic
echo ============================================================================&
:devamet
if exist "C:\Program Files\Microsoft Office\Office16\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office16"
if exist "C:\Program Files (x86)\Microsoft Office\Office16\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office16"
if exist "C:\Program Files\Microsoft Office\Office15\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office15"
if exist "C:\Program Files (x86)\Microsoft Office\Office15\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office15"
if exist "C:\Program Files\Microsoft Office\Office14\ospp.vbs" cd /d "C:\Program Files\Microsoft Office\Office14"
if exist "C:\Program Files (x86)\Microsoft Office\Office14\ospp.vbs" cd /d "C:\Program Files (x86)\Microsoft Office\Office14"
::for %%a in (4,5,6) do (if exist "%ProgramFiles%\Microsoft Office\Office1%%a\ospp.vbs" (cd "%ProgramFiles%\Microsoft Office\Office1%%a")
::if exist "%ProgramFiles(x86)%\Microsoft Office\Office1%%a\ospp.vbs" (cd "%ProgramFiles(x86)%\Microsoft Office\Office1%%a"))
set officedir=%cd%
::echo %officedir%
echo.&
echo ============================================================================&
:secim
set /P e=%ESC%[93mYklenmiŸ tm lisans anahtarlar silinecektir. Silinsin mi? ------%ESC%[0m(%ESC%[101;93mS˜L˜NMES˜ ™NER˜L˜R%ESC%[0m)%ESC%[93m------%ESC%[0m [%ESC%[92mE%ESC%[0m/%ESC%[92mH%ESC%[0m]?
if /I "%e%" EQU "E" goto :lisanssil
if /I "%e%" EQU "H" goto :keygir
goto :secim
:lisanssil
echo Deneme Srm veya YklenmiŸ Tm Lisans Anahtarlar Siliniyor...&
::Office Lisanslarn Sil
::for /f "tokens=8" %b in ('cscript ospp.vbs /dstatus ^| findstr /b /c:"Last 5"') do (cscript ospp.vbs /unpkey:%b)
for /f "tokens=8" %%b in ('cscript ospp.vbs /dstatus ^| findstr /b /c:"Last 5"') do (cscript ospp.vbs /unpkey:%%b)
::@For /F "Tokens=1* Delims=:" %%G In ('^""%__AppDir__%cscript.exe" "%ProgramFiles%\Microsoft Office\Office16\OSPP.VBS" /DStatus 2^> NUL ^| "%__AppDir__%find.exe" "Last 5"^"') Do @For %%I In (%%H) Do @If /I Not "XXXXX" == "%%I" "%__AppDir__%cscript.exe" "%ProgramFiles%\Microsoft Office\Office16\OSPP.VBS" /UnPKey:%%I
::KMS HOST S˜L
cscript //nologo ospp.vbs /remhst
cscript //nologo %SystemRoot%\system32\slmgr.vbs /ckms
::cscript C:\Windows\System32\slmgr.vbs -ckms
::cscript %SystemRoot%\system32\slmgr.vbs -ckms
cscript //nologo %SystemRoot%\system32\slmgr.vbs /cpky
cscript //nologo %SystemRoot%\system32\slmgr.vbs /ckms
rem/||(
cscript ospp.vbs /unpkey:6MWKP
cscript ospp.vbs /unpkey:BTDRB
cscript ospp.vbs /unpkey:DRTFM
cscript ospp.vbs /unpkey:WFG99
cscript ospp.vbs /unpkey:27GXM
)
:keygir
set /p LicenseKey=%ESC%[101;93mLisans Anahtar Gir:%ESC%[0m
cscript //nologo ospp.vbs /inpkey:%LicenseKey%
echo ************************************ &
echo.&
echo.&
echo ============================================================================&
echo Office EtkinleŸtirilecektir...&
echo ============================================================================&
:onoff
set /P f=%ESC%[101;93mOffice ‡evrimi‡i mi etkinleŸtirilsin?%ESC%[0m [%ESC%[92mE%ESC%[0m/%ESC%[92mH%ESC%[0m]?
if /I "%f%" EQU "E" goto :online
if /I "%f%" EQU "H" goto :offline
goto :onoff
:online
::Online Activation
::KMS veya MAK anahtaryla aktivasyon ger‡ekleŸtirir.
cscript //nologo ospp.vbs /act | find /i "Product activation successful" && (echo.&echo ************************************************* &echo.&choice /n /c HE /m "Aktivasyon baŸarl...Kapatmak istiyor musunuz? (E/H)" & if errorlevel 2 goto yenidendene) || (echo Aktivasyon BaŸarsz...! Yeniden baŸlanyor...) &
cscript //nologo ospp.vbs /dstatus
:tekrardene
set /P g=%ESC%[7;31mTekrar denemek ister misiniz?%ESC%[0m [%ESC%[92mE%ESC%[0m/%ESC%[92mH%ESC%[0m]
if /I "%g%" EQU "E" goto :online
if /I "%g%" EQU "H" goto :yenidendene
goto :tekrardene
echo ============================================================================&
:yenidendene
set /P h=%ESC%[101;93mAktivasyon iŸlemine en baŸtan baŸlansn m? %ESC%[0m [%ESC%[92mE%ESC%[0m/%ESC%[92mH%ESC%[0m]?
if /I "%h%" EQU "E" goto :baslangic
if /I "%h%" EQU "H" goto :yedekleme
goto :yenidendene
echo ============================================================================&
:offline
::Offline Activation
::Ykleme ID g”sterir
echo ============================================================================&
echo ============================================================================&
cscript ospp.vbs /dinstid > "%~dp0"\IID_office.txt
pushd %~dp0
start IID_office.txt
echo %ESC%[93mIID_office.txt dosyas a‡lmŸ olmal.%ESC%[0m
echo ============================================================================&
echo %ESC%[93mInstallation ID ksmndan ID numarasn kopyalayn. Kaza ile kapatrsanz dosya yolu aŸa§da belirtilmiŸ. %ESC%[0m
echo ============================================================================&
echo %ESC%[91mIID_office.txt Yolu:%ESC%[0m %ESC%[94m %~dp0IID_office.txt %ESC%[0m
echo ============================================================================&
echo ============================================================================&
echo %ESC%[93mG”sterilen ‡evrimdŸ etkinleŸtirme i‡in Kurulum Kimli§ini (Installation ID) kopyalayn.%ESC%[0m
echo %ESC%[93mOnay Kimli§i (Confirmation ID) alp bu ekrana d”nn.%ESC%[0m
echo ============================================================================&
echo ============================================================================&
:cidgir
echo %ESC%[101;93mNOT:%ESC%[0m %ESC%[91mCID kodu 363624231932455202567656237413441780894815599191 Ÿu formatta olmal. Aralarda - varsa silin.%ESC%[0m
echo ============================================================================&
echo ============================================================================&
echo ============================================================================&
echo ============================================================================&
echo ============================================================================&
pushd %officedir%
set /p CIDKey=%ESC%[101;93mCID Kodunu Gir:%ESC%[0m
cscript //nologo ospp.vbs /actcid:%CIDKey%
::Offline Activation
::KMS veya MAK anahtaryla aktivasyon ger‡ekleŸtirir.
cscript //nologo ospp.vbs /act | find /i "---LICENSED---" && (echo.&echo ************************************************* &echo.&choice /n /c HE /m "Aktivasyon baŸarl...Devam edelim mi? [E/H]" & if errorlevel 2 goto yenidendenensinmi) || (echo Aktivasyon BaŸarsz...! Yeniden baŸlanyor...) &
cscript //nologo ospp.vbs /dstatus
::cscript //nologo ospp.vbs /act | find /i "product activation successful" && (echo.&echo ************************************************* &echo.&choice /n /c HE /m "Aktivasyon baŸarl...Kapatmak istiyor musunuz? (E/H)" & if errorlevel 2 exit) || (echo Aktivasyon BaŸarsz...! Yeniden baŸlanyor...) &
::cscript //nologo ospp.vbs /dstatus | find /i "---LICENSED---" && (echo.&echo ************************************************* &echo.&choice /n /c HE /m "Aktivasyon baŸarl...Kapatmak istiyor musunuz? (E/H)" & if errorlevel 2 exit) || (echo Aktivasyon BaŸarsz...! Yeniden baŸlanyor...) &
:tekrardenensinmi
set /P g=%ESC%[7;31mTekrar denemek ister misiniz?%ESC%[0m [%ESC%[92mE%ESC%[0m/%ESC%[92mH%ESC%[0m]
if /I "%g%" EQU "E" goto :offline
if /I "%g%" EQU "H" goto :yenidendenensinmi
goto :tekrardenensinmi
echo ============================================================================&
:yenidendenensinmi
set /P i=%ESC%[93mAktivasyon iŸlemine en baŸtan baŸlansn m?%ESC%[0m [%ESC%[92mE%ESC%[0m/%ESC%[92mH%ESC%[0m]
if /I "%i%" EQU "E" goto :baslangic
if /I "%i%" EQU "H" goto :yedekleme
goto :yenidendenensinmi
:yedekleme
set /P k=%ESC%[93mYedek Alnsn m?%ESC%[0m [%ESC%[92mE%ESC%[0m/%ESC%[92mH%ESC%[0m]?
if /I "%k%" EQU "E" goto :yedekleniyor
if /I "%k%" EQU "H" goto :devametme
goto :yedekleme
:yedekleniyor
if exist "c:\ofis_yedek" rd /s /q "c:\ofis_yedek"
xcopy /i /e "C:\Windows\System32\spp" "c:\ofis_yedek"
echo %ESC%[93mOffice baŸaryla yedeklendi. Yedekleme dosyalarn gvenilir bir konuma taŸynz.%ESC%[0m
echo %ESC%[93mYedekleme Konumu: "c:\ofis_yedek"%ESC%[0m
:bitis
:devametme
Echo %ESC%[101;93mKurulum ˜Ÿlemi Tamamland...%ESC%[0m
timeout 5
exit
echo.&
echo ============================================================================&
:setESC
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set ESC=%%b
exit /B 0
)
exit /B 0
::BURADA KOD B˜TT˜
::BURADA KOD B˜TT˜