@echo off
if EXIST cgen.log del cgen.log
:input
echo Run echoid.exe and input the last 5 symbols of the Locking Code 1
echo (echoid.exe is located in SAP2000 install folder next to sap2000.exe)
echo Example: Locking Code 1 :   4-16D70
echo          CODE:16D70
SET /P COD=CODE: %=%
if "%COD%"=="" goto input
set #=%COD%
set length=0
:loop
if defined # (set #=%#:~1%&set /A length += 1&goto loop)
if "%length%" NEQ "5" goto input
:datenow
echo License will be valid only one year starting from current date.
echo Enter expire date of license, current date is:
date /t
SET /P dd=Last day: %=%
SET /P mm=Last month: %=%
SET /P yyyy=Last year: %=%
:inputs
echo License will expire on day/month/year: %dd%/%mm%/%yyyy%
set soft=0
echo 1) SAP2000 V14
echo 2) CSiBridge V15 v1
echo 3) Perform3D V4.0.4
echo 4) Etabs V9.7.2
echo 5) Section Bilder
echo 6) Safe
echo 7) Column
echo 8) CSiBridge V15 v2
echo 9) SAP2000 V15
echo 10) Perform3D V5
echo 0) Quit
SET /P soft=Software Choice: %=%
if EXIST lservrc del lservrc
if "%soft%"=="1" goto sap2000_14
if "%soft%"=="2" goto CSiBridge
if "%soft%"=="3" goto performv4
if "%soft%"=="4" goto etabs
if "%soft%"=="5" goto secbuild
if "%soft%"=="6" goto safe
if "%soft%"=="7" goto column
if "%soft%"=="8" goto CSiBridge2
if "%soft%"=="9" goto sap2000_15
if "%soft%"=="10" goto performv5
if "%soft%"=="0" exit
goto inputs
:sap2000_14
set outfile="Sap2000_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
echo on
lsc.exe  -E SAPBR -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPOS -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPSC -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPAPI -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAP -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPPL -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPADC -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPPLC -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPC -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPADI -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPAD -v 14 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:sap2000_15
set outfile="Sap2000_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
echo on
lsc.exe  -E SAPBR -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPOS -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPSC -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPAPI -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAP -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPPL -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPADC -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPPLC -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPC -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPADI -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPAD -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SAPUL -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:CSiBridge
set outfile="CSiBridge_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
lsco.exe  -E CSiBrADR -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:CSiBridge2
set outfile="CSiBridge_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
lsc.exe  -E CSiBrADR -v 15 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:performv4
set outfile="Perform3D_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
lsco.exe  -E Per3D -v 4 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:performv5
set outfile="Perform3D_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
lsc.exe  -E Per3D -v 5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:etabs
set outfile="Etabs_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
lsc.exe  -E EtabNLC -v 9.5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E EtabNLI -v 9.5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E EtabPL -v 9.5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E EtabNL -v 9.5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E EtabPLCC -v 9.5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E EtabPLCS -v 9.5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E EtabPLC -v 9.5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E EtabPLCD -v 9.5 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:secbuild
set outfile="Section_Builder_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
lsco.exe  -E SB -v 8 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsco.exe  -E SBX -v 8 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:safe
set outfile="Safe_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
lsc.exe  -E Safe -v 12 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SafeC -v 12 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SafePTC -v 12 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SafePTI -v 12 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
lsc.exe  -E SafeEd -v 12 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:column
set outfile="Column_%mm%_%dd%_%yyyy%_%COD%_lservrc"
del %outfile%
lsco.exe  -E CSICol -v 8 -o %outfile% -a %dd% -m %mm% -y %yyyy% -C10x4:0x%COD%
goto exitnow
:exitnow
echo off
echo If there is no error rename file: %outfile% to lservrc and copy it to install folder.
pause
cls
goto inputs