目录
    
   
    
     2.通过TTL设定,①指定TeraTerm窗口名称、②让Log中显示时间信息、③指定log名字
    
   
    
     ①课题解决:Accept window title change request 设置为 last
    
   
    ■目录结构
   
     
   
     
   
    ■bat
   
set password=yourPassword
set windowTitle='MyLinux'
"C:\Program Files (x86)\teraterm-4.98\ttpmacro.exe" "%~dp0ttl\autoLogin.ttl" %password%
    ■ttl
   
自动登陆后,执行一条ls -l 命令
password = param2
command = '192.168.131.128:22 /ssh /2  /auth=password /user=sxz001 /passwd='
strconcat command password
connect command 
if result <> 2 then
    messagebox 'Can not connected'
    end
endif
timeout = 10
wait '>' '$' '#'
if result = 0 then
    end
endif
command = "ls -l"
sendln command
wait '$'
sendln 'id'
    ■效果
   
     
   
    ■注意点
   
●平时执行 TeraTerm时,使用的执行文件
“C:\Program Files (x86)\teraterm-4.98\ttermpro.exe”
●执行ttl时,使用的执行文件
“C:\Program Files (x86)\teraterm-4.98\ttpmacro.exe”
    ■更多
   
    1.TeraTerm指定log方式
   
    
     Teraterm的Log设定_sun0322的博客-CSDN博客_teraterm自动保存log
    
   
    2.通过TTL设定,①指定TeraTerm窗口名称、②让Log中显示时间信息、③指定log名字
   
    代码
   
password = param2
command = '192.168.131.128:22 /ssh /2  /auth=password /user=sxz001 /passwd='
strconcat command password
connect command
windowTitle='myLinux'
USERNAME='sxz'
settitle windowTitle
;; if result <> 2 then
;;    messagebox 'Can not connected'
;;     end
;; endif
gettime timestr "%Y%m%d-%H%M%S"
sprintf2 filename 'teraterm_%s_%s_%s.log' windowTitle USERNAME timestr
getdir logdir
strconcat logdir '\log'
changedir logdir
logopen filename 0 0 0 1 0 0 0 
timeout = 10
wait '>' '$' '#'
if result = 0 then
    end
endif
command = "ls -l"
sendln command
    ①课题:不知为何 settile 没有效果
   
     
   
===
需要之后 Reset Remote title
     
   
才能看到下面的效果
    ①指定TeraTerm窗口名称:效果
   
     
   
    ①课题解决:Accept window title change request 设置为 last
   
     
   
    代码调试:当代码不正确时,会有提示
   
缺少上面第一行代码时。。。
     
   
===
     
   
===
    ③指定log名字:效果
   
     
   
注意: 如果TeraTerm侧,已经设置log文件名格式,则ttl中设置的log格式无效
上面从第二个之后,是TeraTerm侧,设置log格式时显示的,log文件名
teraterm_%Y%m%d_%H%M%S_&h.log
    ②让Log中显示时间信息:效果
   
     
   
===
    3.直接在TeraTerm的log设定中指定时间
   
     
   
    3.效果
   
     
   
===
    ■参照
   
 
