2 ::used by SendSourceFileToTarget.bat or by scite editor Tools menu
5 ::echo %~d1\inc\%~n2.pat
9 ::first select part .4TH or .f
11 IF /I "%~x1" == ".4TH" GOTO 4TH
13 :: ==============================================================================================
15 :: %~dpn1.f is the symbolic source file.f described as drive\path\name.f
16 :: %~d1\inc\%~n2.pat is the pattern file for preprocessor gema.exe
17 :: %~dpn1.4TH is the source file.4TH to be sent to the target
18 :: %~d1 is the drive of arg %1
19 :: %~n2 is your selected template by SelectTarget.bat or your scite $(1)
27 echo no file to be preprocessed!
31 IF NOT EXIST %~dpn1.f (
32 echo %~dpn1.f not found!
36 IF NOT EXIST %~d1\inc\%~n2.pat (
37 echo %~d1\inc\%~n2.pat not found!
41 IF /I "%3" == "" GOTO preprocessF
42 IF /I "%3" == "ECHO" GOTO preprocessF
43 IF /I "%3" == "NOECHO" GOTO preprocessF
44 IF /I "%3" == "HALF" GOTO preprocessF
46 echo unexpected third parameter %3 !
54 @%~d1\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~d1\inc\%~n2.pat %~dpn1.f %~dpn1.4TH
55 @call %~d1\config\Select.bat SelectDeviceId %~d1\inc\%~n2.pat
58 @taskkill /F /IM ttermpro.exe 1> NUL 2>&1
61 @"C:\Program Files\teraterm\ttpmacro.exe" /V %~d1\config\SendFile.ttl %~dpn1.4TH /C %3 %deviceid% 1> NUL 2>&1
62 @IF NOT ERRORLEVEL 1 GOTO EndF
65 @"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~d1\config\SendFile.ttl %~dpn1.4TH /C %3 %deviceid%
68 @MOVE "%~dpn1.4TH" "%~dp1\LAST.4TH" > NUL
72 :: ==============================================================================================
73 :: source file.4TH part
74 :: %~dpn1.4TH is the file to be sent described as drive\path\name.4TH
75 :: %~d1 is the drive of param %1
76 :: %~nx0 is name.ext of this bat file
87 IF NOT EXIST %~dpn1.4TH (
88 echo %~dpn1.4TH not found!
92 if /I "%2"=="" GOTO Download4th
93 if /I "%2"=="ECHO" GOTO Download4th
94 if /I "%2"=="NOECHO" GOTO Download4th
95 if /I "%2"=="HALF" GOTO Download4th
97 echo unexpected 2th parameter %2 !
103 @taskkill /F /IM ttermpro.exe 1> NUL 2>&1
106 @"C:\Program Files\teraterm\ttpmacro.exe" /V %~d1\config\SendFile.ttl %~dpn1.4TH /C %2 0 1> NUL 2>&1
107 @IF NOT ERRORLEVEL 1 GOTO End4th
110 @"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~d1\config\SendFile.ttl %~dpn1.4TH /C %2 0
113 @COPY "%~dpn1.4TH" "%~dp1\LAST.4TH" > NUL