2 ::used by CopySourceFileToTarget_SD_Card.bat or by scite editor Tools menu
5 ::echo %~dp1..\inc\%~n2.pat
9 ::first select part .4TH or .f
11 IF /I "%~x1" == ".4TH" GOTO 4TH
13 :: ==============================================================================================
15 :: %~dp0 is the path of this file.bat
16 :: %~dpn1.f is the symbolic source file.f described as drive\path\name.f
17 :: %~d1\inc\%~n2.pat is the pattern file for preprocessor gema.exe
18 :: %~dpn1.4TH is the source file.4TH to be sent to the target
19 :: %~d1 is the drive of arg %1
20 :: %~n2 is your selected template by SelectTarget.bat or your scite $(1)
28 echo no file to be preprocessed!
32 IF NOT EXIST %~dpn1.f (
33 echo %~dpn1.f not found!
37 IF NOT EXIST %~dp0..\inc\%~n2.pat (
38 echo %~dp0..\inc\%~n2.pat not found!
42 IF /I "%3" == "" GOTO preprocessF
44 echo unexpected third parameter %3 !
52 %~dp0..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp0..\inc\%~n2.pat %~dpn1.f %~dpn1.4TH
53 call %~dp0Select.bat SelectDeviceId %~dp0..\inc\%~n2.pat
56 taskkill /F /IM ttermpro.exe 1> NUL 2>&1
59 "C:\Program Files\teraterm\ttpmacro.exe" /V %~dp0SendToSD.ttl %~dpn1.4TH /C %deviceid% 1> NUL 2>&1
60 IF NOT ERRORLEVEL 1 GOTO EndF
63 "C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp0SendToSD.ttl %~dpn1.4TH /C %deviceid%
66 MOVE "%~dpn1.4TH" "%~dp1LAST.4TH" > NUL
70 :: ==============================================================================================
71 :: source file.4TH part
72 :: %~dp0 is the path of this file.bat
73 :: %~dpn1.4TH is the file to be sent described as drive\path\name.4TH
74 :: %~d1 is the drive of param %1
75 :: %~nx0 is name.ext of this bat file
86 IF NOT EXIST %~dpn1.4TH (
87 echo %~dpn1.4TH not found!
91 if /I "%2"=="" GOTO Download4th
93 echo unexpected 2th parameter %2 !
98 taskkill /F /IM ttermpro.exe 1> NUL 2>&1
101 "C:\Program Files\teraterm\ttpmacro.exe" /V %~dp0SendtoSD.ttl %~dpn1.4TH /C 0 1> NUL 2>&1
102 IF NOT ERRORLEVEL 1 GOTO End4th
105 "C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp0SendtoSD.ttl %~dpn1.4TH /C 0