Replies: 1 comment
-
Thank you very much for your attention, but please refrain from posting any scripts here. We do not want to give opportunists the chance to exploit our system by using scripts to infect it with malware. Warning Batch Scripts Are Not Official
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've made a batch file that do the activation.
here's the code :
!!!!!!!!!!!!! Start !!!!!!!!!!!!!!!
@echo off
setlocal
:: Define the help message
set HELP_MESSAGE=Usage: activate.bat [parameter]
::echo Possible parameters: h (home), p (professionnal), e (enterprise), d (education)
:: Check if a parameter was provided
if "%~1"=="" (
echo No parameter provided.
echo %HELP_MESSAGE%
echo Possible parameters:
echo.
echo h for home edition
echo p for professionnal edition
echo e for enterprise edition
echo d for education edition
goto :EOF
)
:: Process the provided parameter
set PARAM=%~1
:: Check predefined list of values
if /I "%PARAM%"=="h" (
echo Activating Home edition...
:: Place the specific code for value1 here
set winkey=TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
goto :activation
)
if /I "%PARAM%"=="p" (
echo Activating Pro edition...
:: Place the specific code for value1 here
set winkey=W269N-WFGWX-YVC9B-4J6C9-T83GX
goto :activation
)
if /I "%PARAM%"=="e" (
echo Activating Enterprise edition...
:: Place the specific code for value1 here
set winkey=NPPR9-FWDCX-D2C8J-H872K-2YT43
goto :activation
)
if /I "%PARAM%"=="d" (
echo Activating Education edition...
:: Place the specific code for value1 here
set winkey=NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
goto :activation
)
:: If the parameter is not recognized
echo Invalid parameter: %PARAM%
echo %HELP_MESSAGE%
goto :EOF
:activation
set command=slmgr /ipk %winkey%
for /f "delims=" %%i in ('%command%') do (
echo %%i
)
set command=slmgr /skms kms8.msguides.com
for /f "delims=" %%i in ('%command%') do (
echo %%i
)
set command=slmgr /ato
for /f "delims=" %%i in ('%command%') do (
echo %%i
)
:end
!!!!!!!!!!!!! end !!!!!!!!!!!!!!!
Beta Was this translation helpful? Give feedback.
All reactions