2 ::used by CopySourceFileToTarget_SD_Card.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)
22 echo no file to be preprocessed!
26 IF NOT EXIST %~dpn1.f (
27 echo %~dpn1.f not found!
31 IF NOT EXIST %~d1\inc\%~n2.pat (
32 echo %~d1\inc\%~n2.pat not found!
36 IF /I "%3" == "" GOTO preprocessF
37 IF /I "%3" == "ECHO" GOTO preprocessF
38 IF /I "%3" == "NOECHO" GOTO preprocessF
39 IF /I "%3" == "HALF" GOTO preprocessF
41 echo unexpected third parameter %3 !
49 ::@%~d1\prog\gema.exe -nobackup -line -t '\n=\r\n;\r\n=\r\n' -f %~d1\inc\%~n2.pat %~dpn1.f %~dpn1.4th
50 @%~d1\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~d1\inc\%~n2.pat %~dpn1.f %~dpn1.4th
53 @taskkill /F /IM ttermpro.exe 1> NUL 2>&1
56 @"C:\Program Files\teraterm\ttpmacro.exe" /V %~d0\config\SendToSD.ttl %~dpn1.4th /C 1> NUL 2>&1
57 @IF NOT ERRORLEVEL 1 GOTO EndF
60 @"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~d0\config\SendToSD.ttl %~dpn1.4th /C
63 @MOVE "%~dpn1.4th" "%~dp1\LAST.4th" > NUL
67 :: ==============================================================================================
68 :: source file.4th part
69 :: %~dpn1.4th is the file to be sent described as drive\path\name.4th
70 :: %~d1 is the drive of param %1
71 :: %~nx0 is name.ext of this bat file
82 IF NOT EXIST %~dpn1.4th (
83 echo %~dpn1.4th not found!
87 if /I "%2"=="" GOTO Download4th
88 if /I "%2"=="ECHO" GOTO Download4th
89 if /I "%2"=="NOECHO" GOTO Download4th
90 if /I "%2"=="HALF" GOTO Download4th
92 echo unexpected 2th parameter %2 !
97 @taskkill /F /IM ttermpro.exe 1> NUL 2>&1
100 @"C:\Program Files\teraterm\ttpmacro.exe" /V %~d0\config\SendtoSD.ttl %~dpn1.4th /C 1> NUL 2>&1
101 @IF NOT ERRORLEVEL 1 GOTO End4th
104 @"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~d0\config\SendtoSD.ttl %~dpn1.4th /C
107 @COPY "%~dpn1.4th" "%~dp1\LAST.4th" > NUL