简体   繁体   English

通过 Windows 命令提示符执行 TeraTerm

[英]TeraTerm execution through the Windows command prompt

I have some basic simple two character commands to be executed in TeraTerm.我有一些基本的简单的两个字符的命令要在 TeraTerm 中执行。

Is there a way to execute the same TeraTerm commands through a Windows command prompt?有没有办法通过 Windows 命令提示符执行相同的 TeraTerm 命令? This will overcome my dependency to open TeraTerm and then running, commands.这将克服我对打开 TeraTerm 然后运行命令的依赖。 I can directly write some .bat file to execute my short commands.我可以直接编写一些 .bat 文件来执行我的短命令。

Assuming that your commands are for teraterm, and not for the OS of your device connected via teraterm, you can save your commands into a .ttl file (using notepad or whatever).假设您的命令用于 teraterm,而不是用于通过 teraterm 连接的设备的操作系统,您可以将命令保存到 .ttl 文件中(使用记事本或其他方式)。 You can still make it work if the commands are for the OS (using a command line or whatever in the shell of the OS program connected), but you will have to make extra commands to navigate to it.如果命令是针对操作系统的(使用命令行或连接的操作系统程序的 shell 中的任何内容),您仍然可以使其工作,但是您必须执行额外的命令才能导航到它。

Using the .ttl file, you can make a .bat file that does two things:使用 .ttl 文件,您可以制作一个 .bat 文件,它可以做两件事:

cd C:\Program Files\teraterm
TTPMacro C:\[point to .ttl file]

This won't prevent teraterm from opening, because if you script involves you interfacing with teraterm at all, it'll open unless you add /V after TTPMcro.这不会阻止 teraterm 打开,因为如果您的脚本涉及您与 teraterm 的接口,除非您在 TTPMcro 之后添加/V ,否则它将打开。 However, it will be a hands free experience.但是,这将是一种免提体验。

You can find out more about deploying the macro here: https://ttssh2.osdn.jp/manual/en/macro/您可以在此处找到有关部署宏的更多信息: https : //ttssh2.osdn.jp/manual/en/macro/

And a list of all the commands here: https://ttssh2.osdn.jp/manual/en/macro/command/index.html以及这里所有命令的列表: https : //ttssh2.osdn.jp/manual/en/macro/command/index.html

And if you need special characters for navigation (ctrl+s, etc), the ASCII code table is here: https://ttssh2.osdn.jp/manual/en/macro/appendixes/ascii.html如果您需要特殊字符进行导航(ctrl+s 等),ASCII 代码表在这里: https : //ttssh2.osdn.jp/manual/en/macro/appendixes/ascii.html

Hope that helps!希望有帮助!


If it's only several basic commands, you can make it without the ttl file by using TTermPro in lieu of TTPMacro.如果只是几个基本命令,可以不用ttl文件,用TTermPro代替TTPMacro。

cd C:\Program Files\teraterm
TTERMPRO /C=1 (connect thru serial com 1)
TTERMPRO etc etc

The syntax for command line using TTERMPRO can be found here: https://ttssh2.osdn.jp/manual/en/commandline/teraterm.html可以在此处找到使用 TTERMPRO 的命令行语法: https ://ttssh2.osdn.jp/manual/en/commandline/teraterm.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM