134 lines
2.4 KiB
Batchfile
134 lines
2.4 KiB
Batchfile
@echo off
|
|
setlocal
|
|
REM TNG Activate
|
|
|
|
REM Initial checks
|
|
echo Checking if you're connected to the Technolog internal network...
|
|
REM ping 10.0.1.1
|
|
ping 10.0.1.2
|
|
if %errorlevel% neq 0 goto oops1
|
|
ping technologsvr.technolog.net
|
|
|
|
echo Checking for elevation
|
|
net config server
|
|
if %errorlevel% neq 0 goto oops2
|
|
|
|
cd %systemroot%\system32
|
|
goto ospicker
|
|
|
|
:ospicker
|
|
REM Finds OS version
|
|
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
|
|
if "%version%" == "10.0" goto win10
|
|
if "%version%" == "6.3" goto win81
|
|
if "%version%" == "6.2" echo Windows 8 (regular) isn't supported currently.
|
|
if "%version%" == "6.1" goto win7
|
|
if "%version%" == "6.0" goto win6
|
|
goto oops3
|
|
|
|
:win6
|
|
echo haven't finished this
|
|
pause
|
|
exit
|
|
|
|
:win7
|
|
echo win2k8r2 dtected
|
|
|
|
set osver=Win2008R2
|
|
|
|
REM Standard key
|
|
cscript slmgr.vbs -ipk YC6KT-GKW9T-YTKYR-T4X34-R7VHC
|
|
|
|
REM Enterprise key
|
|
cscript slmgr.vbs -ipk 489J6-VHDMP-X63PK-3K798-CPX3Y
|
|
|
|
REM Datacenter key
|
|
cscript slmgr.vbs -ipk 74YFP-3QFB3-KQT8W-PMXWJ-7M648
|
|
|
|
goto activate
|
|
REM End 7
|
|
|
|
:win81
|
|
echo win2k12r2 detected
|
|
|
|
set osver=Win2012R2
|
|
REM Standard key
|
|
cscript slmgr.vbs -ipk D2N9P-3P6X9-2R39C-7RTCD-MDVJX
|
|
|
|
REM Datacenter Key
|
|
cscript slmgr.vbs -ipk W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
|
|
|
|
goto activate
|
|
REM End 81
|
|
|
|
:win10
|
|
echo win2k16 or 19 or whatever detected
|
|
|
|
set osver=Win201619
|
|
REM Standard key
|
|
cscript slmgr.vbs -ipk WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY
|
|
|
|
REM Datacenter Key
|
|
cscript slmgr.vbs -ipk CB7KF-BWN84-R7R2Y-793K2-8XDDG
|
|
|
|
goto activate
|
|
REM End 10
|
|
|
|
|
|
:activate
|
|
REM activation portion
|
|
REM timeout 5
|
|
|
|
cscript slmgr.vbs -skms 10.0.1.2
|
|
|
|
REM timeout 5
|
|
|
|
cscript slmgr.vbs -ato
|
|
if %errorlevel% neq 0 goto oops4
|
|
|
|
REM timeout 15
|
|
echo TNG Server System Activated, %computername% - %osver% %date% %time% with %logondomain%\%username% >> "\\technologsvr\batchlogs$\winactlog"
|
|
|
|
endlocal
|
|
exit
|
|
|
|
REM Functions
|
|
|
|
:oops1
|
|
REM Network Fail
|
|
|
|
cls
|
|
color c
|
|
echo You don't seem to be conneted to the TNG Network.
|
|
echo Please connect to it to continue.
|
|
timeout 5
|
|
exit
|
|
|
|
:oops2
|
|
REM Elevation Fail
|
|
|
|
color c
|
|
echo You don't seem to be elevated, you twat. XD
|
|
echo Elevation is required. Right click and run as admin, or contact your sysadmin.
|
|
timeout 5
|
|
exit
|
|
|
|
:oops3
|
|
REM OS Unsupported
|
|
|
|
cls
|
|
color c
|
|
echo Your OS isn't recognized or supported.
|
|
echo am confuse.
|
|
timeout 5
|
|
exit
|
|
|
|
:oops4
|
|
REM Activation Fail
|
|
|
|
echo An error has occurred- please refer to the above for more information.
|
|
echo Send to your local sysadmin if necesssary.
|
|
pause
|
|
exit
|
|
|