
@ECHO OFF
ECHO.

IF NOT "%OS%"=="Windows_NT" GOTO Syntax
IF NOT [%1]==[] GOTO Syntax

SETLOCAL
SET LT=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT=%%A
IF DEFINED LT (
	ECHO 570 is running > %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang > "%~dp0\log.txt"
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)
 
SETLOCAL
SET LT2=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT2=%%A
IF DEFINED LT2 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang2 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT3=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT3=%%A
IF DEFINED LT3 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT4=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT4=%%A
IF DEFINED LT4 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT5=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT5=%%A
IF DEFINED LT5 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)


SETLOCAL
SET LT6=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT6=%%A
IF DEFINED LT6 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT7=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT7=%%A
IF DEFINED LT7 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT8=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT8=%%A
IF DEFINED LT8 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT9=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT9=%%A
IF DEFINED LT9 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT10=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT10=%%A
IF DEFINED LT10 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT11=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT11=%%A
IF DEFINED LT11 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT12=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT12=%%A
IF DEFINED LT12 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT13=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT13=%%A
IF DEFINED LT13 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT14=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT14=%%A
IF DEFINED LT14 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)

SETLOCAL
SET LT15=
FOR /F "tokens=3" %%A IN ('%~dp0\devcon.exe status "@USB\VID_1C7A&PID_0570*" ^| FIND /I "Running"') DO SET LT15=%%A
IF DEFINED LT15 (
	ECHO 570 is running >> %~dp0\log.txt
	GOTO:EOF
) ELSE (
	ECHO 570 is bang3 >> %~dp0\log.txt
	%~dp0\devcon.exe restart "USB\VID_1C7A&PID_0570" >> %~dp0\log.txt
)


ENDLOCAL
GOTO:EOF