Changes
no edit summary
</source>
Batch file for activation via key lists for Windows 7, 8 and 8.1:
<code>
@echo off
set WPKG_DIR=\\your_server\wpkg
REM Check Windows Version
ver | find "5.1." > nul
IF %ERRORLEVEL% EQU 0 goto WIN_XP
ver | find "6.1." > nul
IF %ERRORLEVEL% EQU 0 goto WIN_7
ver | find "6.2." > nul
IF %ERRORLEVEL% EQU 0 goto WIN_8
ver | find "6.3." > nul
IF %ERRORLEVEL% EQU 0 goto WIN_81
goto WARNING
:WIN_XP
echo XP volume license used
exit /b
goto ACTIVATE
:WIN_7
set KEY_FILE=%WPKG_DIR%\packages\WinActivator\win_7_pro.txt
set USED_KEY_FILE=%WPKG_DIR%\packages\WinActivator\used_win_7_pro.txt
goto ACTIVATE
:WIN_8
:WIN_81
set KEY_FILE=%WPKG_DIR%\packages\WinActivator\win_8_pro.txt
set USED_KEY_FILE=%WPKG_DIR%\packages\WinActivator\used_win_8_pro.txt
goto ACTIVATE
:WARNING
echo Unsupported machine OS.
exit /b
:ACTIVATE
REM Noch X Tage bis Ende der vorläufigen Aktivierung
cscript /nologo slmgr.vbs /dli | find "Lizenziert" > NUL
if not errorlevel 1 (
echo Windows ist aktiviert.
exit /b
) else (
echo Windows ist nicht aktiviert.
for /F "tokens=*" %%K in (%KEY_FILE%) do (
findstr /m "%%K" %USED_KEY_FILE% > NUL
if errorlevel 1 (
echo found unused key: %%K
cscript /nologo slmgr.vbs /ipk %%K
if not errorlevel 1 (
echo set key successfully.
cscript /nologo slmgr.vbs /ato
if not errorlevel 1 (
echo successfully activated.
echo %%K %COMPUTERNAME% >> %USED_KEY_FILE%
exit /b
)
)
)
)
)
echo something went wrong.
exit /b 1
</code>
[[Category:Silent Installers]]
[[Category:Changing Windows settings]]