How to run Teraterm and TTL file using Batch file?

自古美人都是妖i 提交于 2019-12-08 05:15:42

问题


From Tera Term. To start MACRO (TTL), select the [Control] Macro command and then the macro file in the Open Macro dialog box.

The question is how to write command inside batch file, to call macro file and run automatically by just opening batch file.

This is the command from previous post.

"C:\Program Files (x86)\teraterm\ttermpro.exe" /I /C=1 /BAUD=115200 /M=C:\Users\Public\test_ttermpro.ttl

From my uderstanding, /M should be command to open macro file. But now, Teraterm is open but don't execute TTL file. Any idea on how to solve this issue?


回答1:


Here the solution for my question. I create a batch file to execute ttpmacro.exe and .TTL file.

@echo on
start "C:\Program Files (x86)\teraterm\ttpmacro.exe" "C:\PCU_BOOTLOADER.TTL"
cls

File location might be different. Baudrate and COM port are set inside TTL file.




回答2:


I don't know why that isn't working but maybe try:

 cd C:\Program Files (x86)\teraterm
 TTERMPRO /I /C=1 /BAUD=115200 /M="C:\Users\Public\test_ttermpro.ttl"

I believe using TTERMPRO, the path to the Macro must be in quotations


Personally, I'd utilize the TTPMacro.exe for this function and define the connection type and baudrate within the ttl, unless there is a reason they might change between executions of the TTL.

Doing it that way, within the .ttl script add near the beginning or where applicable:

 connect '/C=1'
 setspeed 115200

That will define the com port and baud rate of the connection


In the batch file:

 cd C:\Program Files (x86)\teraterm
 TTPMacro /I C:\Users\Public\test_ttermpro.ttl


来源:https://stackoverflow.com/questions/53058951/how-to-run-teraterm-and-ttl-file-using-batch-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!