You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
@ECHO off |
|
REM written by David Schmicker, 13.06.2013 |
|
|
|
REM Konfiguration |
|
REM (Sollten mehrere Matlab Versionen installiert werden, kann hier über Setzen |
|
REM der Path-Variablen die gewünschte Version ausgewählt werden) |
|
SET PATH=C:\Program Files\MATLAB-R2019b\bin;%PATH% |
|
SET PROGEXE=MATLAB.exe |
|
SET MATLABWINDOWTITLE=MATLAB* |
|
SET /A ATTEMPT=1 |
|
|
|
:LOOP |
|
REM Versuche MATLAB zu starten |
|
CLS |
|
ECHO TRYING TO CATCH A LICENSE... [ATTEMPT: %ATTEMPT%] |
|
SET /A ATTEMPT=%ATTEMPT%+1 |
|
%PROGEXE% |
|
|
|
:PAUSE |
|
|
|
REM Wenn Matlab erfolgreich geöffnet wurde |
|
for /f %%i in ('TASKLIST /V /FI "IMAGENAME eq %PROGEXE%" /FI "WINDOWTITLE eq %MATLABWINDOWTITLE%"') do set TEMPSTR=%%i |
|
ping -n 1 localhost > NUL |
|
if %TEMPSTR%==%PROGEXE% GOTO FINAL |
|
|
|
REM Wenn ein License Manager Error auftritt |
|
for /f %%i in ('TASKLIST /V /FI "IMAGENAME eq %PROGEXE%" /FI "WINDOWTITLE eq License Manager Error*"') do set TEMPSTR=%%i |
|
ping -n 1 localhost > NUL |
|
if %TEMPSTR%==%PROGEXE% TASKKILL /F /FI "WINDOWTITLE eq License Manager Error*" |
|
if %TEMPSTR%==%PROGEXE% GOTO LOOP |
|
|
|
REM Wenn Matlab noch lädt |
|
GOTO PAUSE |
|
|
|
:FINAL |
|
ECHO GOT IT! MATLAB is running... |
|
ping -n 5 localhost > NUL |
|
|