Help us understand the problem. What is going on with this article?

Tera Termマクロのパラレル/シリアル実行

More than 3 years have passed since last update.

Tera Term をバッチ起動させる時に、引数を取らせる方法

パラレルで数秒間隔で流す

:変数を使用する場合は以下を参考に
SET myfile=a.txt
start "" "%ProgramFiles(x86)%¥teraterm¥ttpmacro.exe" "%~dp0mymacro.ttl" "aaa" "bbb" %myfile%
timeout 5
start "" "%ProgramFiles(x86)%¥teraterm¥ttpmacro.exe" "%~dp0mymacro.ttl" "ccc" "ddd" %myfile%

注意
%~dp0 はバッチファイルの存在するフォルダを表す
引数を変えることで、同じマクロに違う引数を取らせてパラレルで実行させることができます

シリアルで流したい場合

最初の [start ""]をなくして実行すれば、1つめのテラタームマクロが完了するまで、次のマクロは流れません

呼び出されるマクロの例


```
sendln ' ssh user@192.168.1.1'
wait ':'
sendln 'passwd'
wait '$'

;現在のフォルダパスを取得
getdir macrodir

;引数の確認
messagebox param2 'param2'
messagebox param3 'param3'

;ディレクトリを作って、タイムスタンプ付きのログを取得する
getdate dirname "%Y%m%d"
foldercreate dirname
setdir dirname
getdir logdir
changedir logdir

;ログファイル名を作る
getdate mytime "%H%M%S"
sprintf2 logname '%s_%s' dirname mytime
logopen logname 0 1 0 1

sendln 'date'




Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした