ttler.hta 0.01版
とりあえずcygwinに接続して動いたもの。

実行可コマンドのリスト。commands.iniファイル
あまちがった、とかまずいというときは「いいえ」を選択すれば、そこでマクロ終了。

でこんな感じのテキストファイルを実行して

マクロファイル。「sample improper command line」の行は実行しないようにコメントアウト

実行可コマンドのリスト。commands.iniファイル
//cmd,ポプアップ有り1タブ区切りで2つめに1を設定すると、ポップアップでマクロの続行を問い合わせ。
awk
nawk
bash
cat 1
rm 1
cd
・・・
あまちがった、とかまずいというときは「いいえ」を選択すれば、そこでマクロ終了。

でこんな感じのテキストファイルを実行して
sleep 22回目のcatコマンドのポップアップで「いいえ」するとこんな具合
csh
cat test.txt
echo "smp1" > test.txt
echo "smp2" >> test.txt
ls -l test.txt
cat test.txt
rm -f cat test.txt
sample improper command line

マクロファイル。「sample improper command line」の行は実行しないようにコメントアウト
serverIP = '10.1.68.104'
UserName = 'uid'
Password = 'pss'
UsernamePrompt = 'login:'
PasswordPrompt = 'Password:'
timeout = 0
show 0
;──┐
;接続│
;──┘cygconnect
connect serverIP
wait UsernamePrompt
sendln Username
wait PasswordPrompt
sendln Password
;────┐
;ログ出力│
;────┘
logPath = 'C:\Users\b\Desktop\'
logNm = 'test.log'
strconcat logPath logNm
logopen logPath 0 0
settitle logNm
;─────┐
;実行前確認│
;─────┘
yesnobox '実行しますか?' logNm
if result=0 goto endSub
wait '}%' '$ '
sendln 'who am i;date'
wait '}%' '$ '
sendln 'sleep 2'
wait '}%' '$ ' '? '
sendln 'csh'
wait '}%' '$ ' '? '
sendln 'cat test.txt'
call yesnoSub
wait '}%' '$ ' '? '
sendln 'echo "smp1" > test.txt'
wait '}%' '$ ' '? '
sendln 'echo "smp2" >> test.txt'
wait '}%' '$ ' '? '
sendln 'ls -l test.txt'
wait '}%' '$ ' '? '
sendln 'cat test.txt'
call yesnoSub
wait '}%' '$ ' '? '
sendln 'rm -f cat test.txt'
wait '}%' '$ ' '? '
;;;sample improper command line
goto endSub
:strScanE
;wait #10
recvln
strscan inputstr '。'
if result>1 call alertSub
wait '}%' '$ ' '? '
return
:yesnoSub
yesnobox '出力結果を確認して続行してください' logNm
if result<1 then
goto endSub
else
return
endif
:endSub
messagebox 'TTL終了' logNm
sendln 'date'
wait '}%' '$ '

