-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhimawari-rx__sataid.bat
166 lines (111 loc) · 3.56 KB
/
himawari-rx__sataid.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
@echo off
setlocal enabledelayedexpansion
title himawari-rx_sataid
echo '-----------------------------------------------------------'
echo ' himawari-rx__sataid.bat '
echo 'This is the sataid script(start by decode script automatic)'
echo ' '
echo ' @tcjj3 github.com/tcjj3/himawari-rx_auto_scripts '
echo '-----------------------------------------------------------'
set str=
set str=%1
if not defined str (
echo This script can't run directly!
echo Press any key to exit this script...
pause
exit
) else (
title himawari-rx_sataid - Files Dir: %1\%2
echo Files Dir: %1\%2
)
mkdir %1\SATAID >nul
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B04_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B05_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B06_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B07_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B09_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B10_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B11_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B12_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B14_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01B16_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01IR1_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01IR2_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01IR3_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01IR4_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
Set firstLine=1
for /f "delims=" %%k in ('dir /b %1\%2\IMG_DK01VIS_*') do (
if !firstLine!==1 call :Proc_File %1 %2 %%k
Set firstLine=0
)
if not exist himawari-rx__rmdir.bat (
copy /y NUL %1\%2\decoded.txt >NUL
) else (
start himawari-rx__rmdir.bat %1\%2
)
exit
:Proc_File
Set "fn=%3"
for %%a in ("%fn%") do set "FileName=%%~na"
Set "FileName=%FileName:~0,24%"
Set "FilePath=%1\%2\%FileName%"
hrit2sataid\hritconcat.exe -d1=%FilePath%_001 -d2=%FilePath%_002 -d3=%FilePath%_003 -d4=%FilePath%_004 -d5=%FilePath%_005 -d6=%FilePath%_006 -d7=%FilePath%_007 -d8=%FilePath%_008 -d9=%FilePath%_009 -d10=%FilePath%_010 -o=%FilePath%.hrit -p
hrit2sataid\hrit2sataid.exe -z %FilePath%.hrit %FilePath%.Z%2 hrit2sataid\hrit2sataid_FullDisk.ini
move %FilePath%.Z%2 %1\SATAID\%FileName%.Z%2 >nul
goto :EOF