はじめてのteramacro

パクリまくりのteramacro

 

; sample macro of Tera Term
;
; File: ssh2login.ttl
; Description: auto login with SSH2 protocol
; Environment: generic
; Update: 2016/4/5
; Author: kenkenken0102

username = 'root' ; 「nike」をログインに使用するユーザー名に書き換える
hostname = '192.168.3.111' ; 「192.168.1.3」を接続するサーバーのIPアドレス/サーバー名に書き換える

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

msg = 'Enter password for user '
strconcat msg username
passwordbox msg 'Get password' ; パスワードボックスを表示し、入力された内容を変数msgに格納

msg = hostname
strconcat msg ':22 /ssh /auth=password /user='
strconcat msg username
strconcat msg ' /passwd='
strconcat msg inputstr

connect msg

logdir = 'C:\Users\yoshida\Desktop\teramacro\';

logfile = logdir
strconcat logfile username
strconcat logfile '@'
strconcat logfile hostname
getdate datetime '-%Y%m%d-%H%M%S'
strconcat logfile datetime
strconcat logfile '.log'
logopen logfile 0 1