Office 2021 yuklemeye çalışiyorum 365 yukleniyor

  • Konbuyu başlatan Konbuyu başlatan vedat
  • Başlangıç tarihi Başlangıç tarihi
Kodla Büyü

vedat

Seçkin Üye
Seçkin Üye
Mesajlar
687
Ofis2021 kurmaya kalkıyorum 365 oluyor ne kadar kaldirmaya kalksamda 365 aktif oluyor.
 
Ürün anahtarlarını kaldırmalısınız. Bu yüzden.
@echo off
setlocal

:: Define the possible Office installation paths
set Office64Path=C:\Program Files\Microsoft Office\Office16
set Office32Path=C:\Program Files (x86)\Microsoft Office\Office16

:: Check if 64-bit Office is installed
if exist "%Office64Path%" (
cd /d "%Office64Path%"
goto :LicenseCheck
)

:: Check if 32-bit Office is installed
if exist "%Office32Path%" (
cd /d "%Office32Path%"
goto :LicenseCheck
)

:: If neither 32-bit nor 64-bit Office is found, display an error
echo No Office installation found in either 32-bit or 64-bit directories.
pause
exit /b

:LicenseCheck
:: Get the license status and find the last 5 digits of the product key
for /f "tokens=5" %%A in ('cscript ospp.vbs /dstatus ^| findstr /i "Last 5 characters"') do set productKey=%%A

:: Check if the product key was found
if "%productKey%"=="" (
echo No product key found.
pause
exit /b
)

:: Display the found product key
echo Product key found: %productKey%

:: Remove the product key using the last 5 characters
cscript ospp.vbs /unpkey:%productKey%

:: Notify the user that the product key has been removed
echo Product key %productKey% has been successfully removed.
pause



Yukarıdaki kodu note defterine yapıştırıp bat uzantılı dosya olarak kaydetin ve scripti çalıştırın
 
Veya bu kodu dene.
@echo off
setlocal

:: Office kurulum yollarını tanımla
set "Office64Path=C:\Program Files\Microsoft Office\Office16"
set "Office32Path=C:\Program Files (x86)\Microsoft Office\Office16"

:: 64-bit Office kurulu mu kontrol et
if exist "%Office64Path%" (
call :LicenseCheck "%Office64Path%"
goto :EOF
)

:: 32-bit Office kurulu mu kontrol et
if exist "%Office32Path%" (
call :LicenseCheck "%Office32Path%"
goto :EOF
)

:: Hiçbir Office kurulumu bulunamazsa hata mesajı göster
echo 32-bit veya 64-bit Office kurulumu bulunamadı.
exit /b

:LicenseCheck
set "OfficePath=%~1"
cd /d "%OfficePath%"

:: Lisans durumunu al ve ürün anahtarının son 5 karakterini bul
for /f "tokens=5" %%A in ('cscript ospp.vbs /dstatus ^| findstr /i "Last 5 characters"') do set "productKey=%%A"

:: Ürün anahtarı bulunamazsa hata mesajı göster
if "%productKey%"=="" (
echo Ürün anahtarı bulunamadı.
exit /b
)

:: Bulunan ürün anahtarını göster
echo Ürün anahtarı bulundu: %productKey%

:: Ürün anahtarını kaldır
cscript ospp.vbs /unpkey:%productKey%

:: Ürün anahtarının başarıyla kaldırıldığını bildir
echo Ürün anahtarı %productKey% başarıyla kaldırıldı.
exit /b
 
Son düzenleme:
Geri
Üst