[SOLVED] Script can not find available COM port automatically
Hi!
I'm talking here about script "StartTTPL4.bat".
I've removed "rem" before "pause" word at the end to see results of the script.
Results are: "Error! No Com port available !"
But I'm sute that it's available, because I can select it manually in teraterm and see in device manager (COM4 in my case).
Can I fix the script somehow to make it work automatically, how it should be?
What data do you need to help me with that?
I'm not strong enough in windows bash scripting.
There's full script log if I'll remove "rem" before "echo on" at the start.
C:\STM32SecuWS\Tools\teraterm>SET DIR_MYSCRIPT=C:\STM32SecuWS\Tools\teraterm\
C:\STM32SecuWS\Tools\teraterm>call :getport COMPORT
C:\STM32SecuWS\Tools\teraterm>FOR /F "tokens=4 USEBACKQ" %F IN (`mode | find " COM"`) DO (
echo %F
if %F NEQ CON: SET COMPORT=%F
)
C:\STM32SecuWS\Tools\teraterm>echo Return : COMPORT
Return : COMPORT
C:\STM32SecuWS\Tools\teraterm>rem GOTO :EOF
C:\STM32SecuWS\Tools\teraterm>GOTO :End
C:\STM32SecuWS\Tools\teraterm>endlocal
C:\STM32SecuWS\Tools\teraterm>pause
any key to continue . . .
C:\STM32SecuWS\Tools\teraterm>if "" == "" goto ErrorCOM
C:\STM32SecuWS\Tools\teraterm>echo "Error! No Com port available !"
"Error! No Com port available !"
C:\STM32SecuWS\Tools\teraterm>goto End
C:\STM32SecuWS\Tools\teraterm>endlocal
C:\STM32SecuWS\Tools\teraterm>pause
any key to continue . . .