-
Notifications
You must be signed in to change notification settings - Fork 9
/
ConfigureTool.bat
187 lines (165 loc) · 3.65 KB
/
ConfigureTool.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
@echo off
@setlocal enableextensions enabledelayedexpansion
title Reine Print 配置工具
:mainmenu
cls
set choose=0
echo 本工具可以对功能进行配置
echo 请确保设置前已经停止运行
echo =============
echo [1]接收服务管理
echo [2]格式支持管理
echo [3]打印日志管理
echo [4]打印机检测开关
echo =============
set /p choose=请输入数字
if %choose%==1 goto receivers
if %choose%==2 goto format
if %choose%==3 goto log
if %choose%==4 goto printerdetect
goto mainmenu
:receivers
cls
set choose=0
echo 接收服务管理
echo =============
echo [1]启用一个接收服务
echo [2]停用一个接收服务
echo [3]查询服务列表
echo [4]返回
echo =============
set /p choose=请输入数字
if %choose%==1 goto receiveron
if %choose%==2 goto receiveroff
if %choose%==3 goto receiverlist
if %choose%==4 goto mainmenu
goto receivers
:receiveron
set name=
cls
set /p name=输入需要启用的服务名
if not exist receivers\%name%\Service.disable goto noreceiver
rename receivers\%name%\Service.disable Service.bat
echo 已启用%name%
ping 127.1 >nul -n 3
goto receivers
:receiveroff
set name=
cls
set /p name=输入需要停用的服务名
if not exist receivers\%name%\Service.bat goto noreceiver
rename receivers\%name%\Service.bat Service.disable
echo 已停用%name%
ping 127.1 >nul -n 3
goto receivers
:noreceiver
echo 该服务不存在或当前状态无法进行该操作
ping 127.1 >nul -n 3
goto receivers
:receiverlist
cls
for /d %%i in (receivers\*) do (
if exist %%i\Service.bat (
echo %%i处于启用状态
)
if exist %%i\Service.disable (
echo %%i处于停用状态
)
)
echo 按任意键返回
pause >nul
goto receivers
:format
cls
set choose=0
echo 格式支持管理
echo =============
echo [1]启用一个格式
echo [2]停用一个格式
echo [3]查询格式列表
echo [4]切换格式后端引擎
echo [5]返回
echo =============
set /p choose=请输入数字
if %choose%==1 goto formaton
if %choose%==2 goto formatoff
if %choose%==3 goto formatlist
if %choose%==4 goto formatengine
if %choose%==5 goto mainmenu
goto format
:formaton
set name=
cls
set /p name=输入需要启用的格式
if not exist printmodule\%name%\print.bat_disable goto formaterror
rename printmodule\%name%\print.bat_disable print.bat
echo 已启用%name%
ping 127.1 >nul -n 3
goto format
:formatoff
set name=
cls
set /p name=输入需要禁用的格式
if not exist printmodule\%name%\print.bat goto formaterror
rename printmodule\%name%\print.bat print.bat_disable
echo 已禁用%name%
ping 127.1 >nul -n 3
goto format
:formatlist
cls
for /d %%i in (printmodule\*) do (
if exist %%i\print.bat (
echo %%i处于启用状态
)
if exist %%i\print.bat_disable (
echo %%i处于停用状态
)
)
echo 按任意键返回
pause >nul
goto format
:formatengine
cls
set /p name=输入需要配置的格式
if not exist printmodule\%name%\config.bat goto formaterror
call printmodule\%name%\config.bat
cls
goto format
:formaterror
echo 该格式不存在或该操作当前不被该格式支持
ping 127.1 >nul -n 3
goto format
:log
cls
set choose=0
echo 打印日志管理
echo =============
if exist config\printlog.enable (
echo [1]禁用打印日志)else (
echo [1]启用打印日志)
echo [2]查看打印日志
echo [3]返回
echo =============
set /p choose=请输入数字
if %choose%==1 goto switchlog
if %choose%==2 if exist logs\print.log (start logs\print.log)else (cls&echo 打印日志不存在&ping 127.1 >nul -n 2&goto log)
if %choose%==3 goto mainmenu
goto log
:switchlog
cls
if exist config\printlog.enable (
rename config\printlog.enable printlog.disable
echo 已禁用打印日志)else (
rename config\printlog.disable printlog.enable
echo 已启用打印日志)
ping 127.1 >nul -n 2
goto log
:printerdetect
cls
if exist config\detectonline.enable (
rename config\detectonline.enable detectonline.disable
echo 已禁用打印机检测,无视打印机是否在线)else (
rename config\detectonline.disable detectonline.enable
echo 已启用打印机检测,打印机离线后暂停任务)
ping 127.1 >nul -n 2
goto mainmenu