Skip to content

Instantly share code, notes, and snippets.

@isann
Created July 3, 2012 06:00
Show Gist options
  • Save isann/3037980 to your computer and use it in GitHub Desktop.
Save isann/3037980 to your computer and use it in GitHub Desktop.
teratermログイン自動化マクロ
;; -------------------------------------
;; TeraTerm ログインスクリプト
;; SSHで接続する。
;; ログを取る。
;; Version 4.64で動作確認
;; -------------------------------------
;; ログインユーザー名(アカウント)
strUsername = 'hoge'
strPassword = 'hoge'
;; 接続先(ホスト名またはIPアドレス)
strHostname = 'XXX.XXX.XXX.XXX'
;; ログファイル
logName = "C:\tmp\teraterm-log\TTM-%Y%m%d-%H%M%S."
strconcat logName strHostname
strconcat logName ".log"
getdate strLogfile logName
;; 接続準備
strConnect = strHostname
strconcat strConnect ':22 /ssh /auth=password /user='
strconcat strConnect strUsername
strconcat strConnect ' /passwd='
strconcat strConnect strPassword
;; 接続
connect strConnect
;; ログを取る
logopen strLogfile 1 0
;; 任意コマンド
wait '# '
sendln "alias ll='ls -las'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment