Windows 统计电脑安装的软件

起因

近期接到一个特殊任务,需要统计公司几十号员工电脑安装的软件信息,看一下哪些软件存在版权风险,好提前想办法规避。

没有学习过PowerShell相关开发的我也是一头雾水,幸运的是在网上找到一位大姥的分享,于是就拿过来改了一下;主要就是添加一个统计完自动上传结果到服务器的配置,这样就只需要每一位员工下载后双击执行一下转换后的.exe程序并输入自己的中文名就可以完成统计了。

.bat 转换 .exe 工具Bat To Exe Converter

统计脚本

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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
@echo off&color 3f&cls
title 飞尔智能软件统计程序:Czz
echo Loading ...
set "fcn=1%1"
if %fcn% equ 1 ( mode con cols=82 lines=24 &TITLE 获取已安装程序列表) else (goto end_of_uac)

:: 检查 OS
chcp|find "936" >nul 2>nul
if %errorlevel% equ 0 ( goto uac )
ver|find "6.1" >nul
if %errorlevel% equ 0 ( goto uac )
ver|find "6.2" >nul
if %errorlevel% equ 0 ( goto uac )
ver|find "6.3" >nul
if %errorlevel% equ 0 ( goto uac )
ver|find "10.0." >nul
if %errorlevel% equ 0 ( goto uac )
call :error0

:: 触发UAC
:uac
mode con cols=40 lines=3 &color 3f&echo.
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo 请在弹出的窗口中点击“是”运行此脚本。
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:end_of_uac

mode con cols=82 lines=24

setlocal EnableDelayedExpansion
set "inff=%temp%\%random%%random%%random%%random%%random%.inf"
set "regf=%temp%\%random%%random%%random%%random%%random%.reg"
:: 运行模式 0 正常 1 调试 2对比
set test=2


call :date_time
set "time1=%current_date% %current_time%"
if "%fcn%" equ "1" (set "lb= 获取已安装程序列表 Czz"
) else (set lb=%2
set lb=%lb:~1,-1%)
set "line1==================================================================================="
cls&echo%line1%&echo%lb%&echo%line1%
set "n_app1=0"&set "n_app2=0"&set "n_app3=0"
set "ISListf=%temp%\InstalledSoftwareList.txt"
set "LOCF=%temp%\List_Of_Concerns.txt"
set "LOIAOCF=%temp%\ListOfInstalledApplicationsOfConcern.txt"
set "LOIAF=%temp%\List_Of_Ignored_Apps.txt"
set "file1=%temp%\00000000001.txt"
set "file2=%temp%\00000000002.txt"
set "file01=%temp%\010000000001.txt"
set "file02=%temp%\020000000002.txt"
set "file03=%temp%\030000000003.txt"
set "file001=%temp%\0010000000001.txt"
set "file002=%temp%\0020000000002.txt"
set "input_file0=%temp%\input.txt"
set "output_file0=%temp%\output.txt"

if "%fcn%" neq "1" (set test=0 &goto test_end)
if %test% equ 0 goto test_end
if %test% equ 2 (set info1=对比模式&goto test2)
if %test% neq 1 call :error1
set info1=调试模式
:test1
set "ISListf=%~dp0InstalledSoftwareList.txt"
set "LOCF=%~dp0List_Of_Concerns.txt"
set "LOIAOCF=%~dp0ListOfInstalledApplicationsOfConcern.txt"
set "LOIAF=%~dp0List_Of_Ignored_Apps.txt"
set "file1=%~dp01.txt"
set "file2=%~dp02.txt"
set "file01=%~dp001.txt"
set "file02=%~dp002.txt"
set "file03=%~dp003.txt"
set "file001=%~dp0001.txt"
set "file002=%~dp0002.txt"
set "input_file0=%~dp0input.txt"
set "output_file0=%~dp0output.txt"
:test2
cls&echo%line1%&echo%lb%&echo%line1%
echo 【%info1%】
echo 1.查询注册表获取获取已安装程序列表
echo.
::echo 2.使用WMIC命令取获取已安装程序列表
echo.
echo.
echo 此程序不会获取任何个人隐私信息,请放心使用。
echo.
choice /C 10 /m:请选择功能

if %errorlevel% equ 3 goto end
if %errorlevel% equ 2 goto end
::if %errorlevel% equ 2 (call :del_files1&call :del_files2&call :wmic_get_applist&call :del_files1&pause >nul&goto end)
call :date_time
set "time1=%current_date% %current_time%"
:test_end

del "%ISListf%" /q >nul 2>nul
del "%LOIAOCF%" /q >nul 2>nul
del "%LOIAF%" /q >nul 2>nul

call :del_files1
call :del_files2
call :chk_reg_lock

:start
set /p username= 请输入您的中文名:
echo %username%|findstr "[a-zA-Z0-9]" >nul&&(
goto start)||echo goto start2

:start2
cls&echo%line1%&echo%lb%&echo%line1%
echo 正在查询注册表 ...
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall /s >"%file1%" 2>nul
reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall /s >"%file2%" 2>nul
if exist "%file1%" (set ft1=1) else (set ft1=0)
if exist "%file2%" (set ft2=1) else (set ft2=0)
set /a ft=%ft1% + %ft2%
if %ft% equ 2 (copy /b "%file1%" + /b "%file2%" "%file1%" >nul 2>nul&goto next_0001)

:next_0001
call :del_junk_info
copy "%file1%" "%file01%" >nul 2>nul

echo %PROCESSOR_ARCHITECTURE% |find "64" >nul
if %errorlevel% equ 0 (reg query HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall /s >"%file1%" 2>nul
call :del_junk_info
copy "%file1%" "%file02%" >nul 2>nul)
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products /s >"%file1%" 2> nul
call :del_junk_info
call :chk_reg_unlock
copy "%file1%" "%file03%" >nul 2>nul


echo 正在删除重复计算的数据 ...
echo %PROCESSOR_ARCHITECTURE% |find "64" >nul
if %errorlevel% equ 0 ( call :del_repeating_data "%file01%" "%file02%" "%file001%" ) else (copy "%file01%" "%file001%" >nul 2>nul)
call :del_repeating_data "%file001%" "%file03%" "%file002%"
for /f "tokens=3 delims= " %%i in ('find /v /c "" "%file002%" ') do (set "n_app1=%%i")

echo 正在处理忽略清单 ...
call :Ignored_Apps
for /f "tokens=3 delims= " %%i in ('find /v /c "" "%file002%" ') do (set "n_app2=%%i")
set /a n_app3=%n_app1% - %n_app2%
ren "%file002%" "InstalledSoftwareList.txt" >nul
call :Apps_Of_Concerns
if exist "%LOIAOCF%" (Explorer "%LOIAOCF%")
call :del_files1
call :date_time
set "time2=%current_date% %current_time%"
call :time_interval time_interval_val "%time1%" "%time2%" >nul
echo.
if %n_app3% equ 0 (set "info2=。") else ( set "info2=,其中 %n_app3% 个应用未予显示。")
if %isllocn% equ 0 (set "info3=。") else ( set "info3=,其中 %isllocn% 个应用请予关注。")
::echo 查询到已安装应用 %n_app1% 个%info2%
::echo 呈现给您的应用为 %n_app2% 个%info3%
echo 查询到已安装应用 %n_app2% 个%info3%
echo 用时 %time_interval_val% 秒。
if %n_app2% neq 0 Explorer "%ISListf%" > nul
copy %ISListf% C:\%username%.csv
goto select_ftp

echo 准备上传统计数据……
:select_ftp
echo ftp>C:\ftp.up
echo open crontab-ftp.feiersmart.com >>C:\ftp.up
echo dev1>>C:\ftp.up
echo ixaOvvhZHxozzd5n>>C:\ftp.up
echo binary>>C:\ftp.up
echo cd feier>>C:\ftp.up
echo dir>>C:\ftp.up
Echo bye>>C:\ftp.up
FTP -s:C:\ftp.up >C:\ftp.txt
findstr "%username%.csv" C:\ftp.txt >nul
if errorlevel 1 (
echo.
del C:\ftp.txt
goto ftp_put
) else (
echo.
del C:\ftp.txt
set /p filename= 您已上传过统计数据,是否继续上传 y or n:
goto yorn
)

:yorn
if %filename% equ y (
goto ftp_put
) else (
if %filename% == n (
goto quit
) else (
set /p filename= 您的输入已超出范围,请重新输入 y or n:
goto yorn
)
)

:ftp_put
echo ftp>C:\ftp.up
echo open crontab-ftp.feiersmart.com >>C:\ftp.up
echo dev1>>C:\ftp.up
echo ixaOvvhZHxozzd5n>>C:\ftp.up
echo binary>>C:\ftp.up
echo cd feier>>C:\ftp.up
echo put C:\%username%.csv>>C:\ftp.up
Echo bye>>C:\ftp.up
FTP -s:C:\ftp.up >nul

echo ftp>C:\ftp.up
echo open crontab-ftp.feiersmart.com >>C:\ftp.up
echo dev1>>C:\ftp.up
echo ixaOvvhZHxozzd5n>>C:\ftp.up
echo binary>>C:\ftp.up
echo cd feier>>C:\ftp.up
echo dir>>C:\ftp.up
Echo bye>>C:\ftp.up
FTP -s:C:\ftp.up >C:\ftp.txt
findstr "%username%.csv" C:\ftp.txt >nul
if errorlevel 1 (
echo.
del C:\ftp.txt
echo 上传失败,请再次运行该程序,多次上传失败请联系管理员处理……
del C:\ftp.up
goto quit
) else (
echo.
del C:\ftp.txt
echo 统计结果上传成功。
del C:\ftp.up
goto quit
)

:quit
echo.
echo 请按任意键退出:
Pause > nul
exit




goto end
:error0
cls&color 47&echo.&echo.&echo.&echo.&echo.&echo.
echo 脚本只能在指定的 Windows 产品上运行。&echo.
echo The script can only be run on Windows designated product.
pause >nul & goto end

:error1
cls&color 47&echo.&echo.&echo.&echo.&echo.&echo.
echo 您想干个啥?
pause >nul & goto end

:: 删除重复信息 入file1,出file1
:del_repeating_data
set input_file1=%1
set input_file2=%2
set output_file1=%3
set input_file1=%input_file1:~1,-1%
set input_file2=%input_file2:~1,-1%
set output_file1=%output_file1:~1,-1%
del "%output_file1%" /q >nul 2>nul
for /f "delims=" %%f in ('type %input_file1% ') do (
set "tpt=%%f"
findstr /x /b /c:"!tpt!" "%input_file2%" >nul
if !errorlevel! equ 1 (echo %%f>>"%output_file1%")
)
copy /b "%output_file1%" + "%input_file2%" "%output_file1%" >nul 2>nul
goto :eof


:: 删除垃圾信息 入file1,出file1
:del_junk_info
type "%file1%" >"%file2%"
findstr "DisplayName" "%file2%" >"%file1%"
findstr /v /r /i "ParentDisplayName" "%file1%" > "%file2%"
findstr /v /r /i "Update for" "%file2%" > "%file1%"
findstr /v /r /i "DisplayName_Localized" "%file1%" > "%file2%"
findstr /v /r /i "Security Update" "%file2%" > "%file1%"
findstr /v /r /i "Service Pack" "%file1%" > "%file2%"
findstr /v /r /i "kb0" "%file2%" >"%file1%"
findstr /v /r /i "kb1" "%file1%" >"%file2%"
findstr /v /r /i "KB2" "%file2%" >"%file1%"
findstr /v /r /i "kb3" "%file1%" >"%file2%"
findstr /v /r /i "kb4" "%file2%" >"%file1%"
findstr /v /r /i "kb5" "%file1%" >"%file2%"
findstr /v /r /i "kb6" "%file2%" >"%file1%"
findstr /v /r /i "kb7" "%file1%" >"%file2%"
findstr /v /r /i "kb8" "%file2%" >"%file1%"
findstr /v /r /i "kb9" "%file1%" >"%file2%"
findstr /v /r /i "^$" "%file2%" > "%file1%"
del "%file2%" /q >nul 2>nul
for /f "tokens=3* delims= " %%i in ('type %file1% ') do (echo %%i %%j>>"%file2%")
call :del_right_left_sp_per_row "%file2%" "%file1%"
goto :eof



:: 删除文本文件每行两侧空格
:del_right_left_sp_per_row
set input_file0=%1
set output_file0=%2
set input_file0=%input_file0:~1,-1%
set output_file0=%output_file0:~1,-1%
del "%output_file0%" /q >nul 2>nul
for /f "tokens=1* delims=" %%i in ('type "%input_file0%"') do (
set "tpt=%%i"
call :del_right_left_sp
echo !tpt!>>"%output_file0%"
)
del "%input_file0%" /q >nul 2>nul
goto :eof
:: 删除字符串两侧空格
:del_right_left_sp
:del_right_ch
if "%tpt:~-1%"==" " set tpt=%tpt:~0,-1%&&goto del_right_ch
:del_left_ch
rem if "%tpt:~0,1%"==" " set "tpt=%tpt:~1%"&&goto del_left_ch
goto :eof

:date_time
set "current_date=%date:~0,4%-%date:~5,2%-%date:~8,2%"&set "current_time=%time:~0,2%:%time:~3,2%:%time:~6,2%"
set "current_time=%current_time: =0%"
goto :eof


::日期时间差 code by foxjl
:time_interval
set time1=%2
set time1=%time1:~1,-1%
set time2=%3
set time2=%time2:~1,-1%
for /f "tokens=1,2,3,4,5,6,7 delims=-/:. " %%i in ("%time1%") do ((set Y1=%%i) && (set M1=%%j) && (set D1=%%k) && (set H1=%%l) && (set F1=%%m) && (set S1=%%n) && (set MS1=%%o))
for /f "tokens=1,2,3,4,5,6,7 delims=-/:. " %%i in ("%time2%") do ((set Y2=%%i) && (set M2=%%j) && (set D2=%%k) && (set H2=%%l) && (set F2=%%m) && (set S2=%%n) && (set MS2=%%o))
set /a secs=((d2-32075+1461*(y2+4800+(m2-14)/12)/4+367*(m2-2-(m2-14)/12*12)/12-3*((y2+4900+(m2-14)/12)/100)/4)*86400+H2*3600+F2*60+S2)-((d1-32075+1461*(y1+4800+(m1-14)/12)/4+367*(m1-2-(m1-14)/12*12)/12-3*((y1+4900+(m1-14)/12)/100)/4)*86400+H1*3600+F1*60+S1)
rem set /a D=secs/86400,H=(secs%%86400)/3600,M=(secs%%3600)/60,S=secs%%60
rem set "H=0%H%"&set "M=0%M%"&set "S=0%S%"
rem set "H=%H:~-2%"&set "M=%M:~-2%" &set "S=%S:~-2%"
rem set %1=%H%:%M%:%S%
set %1=%secs%
goto :eof


:del_files1
del "%file1%" /q >nul 2>nul
del "%file2%" /q >nul 2>nul
del "%file01%" /q >nul 2>nul
del "%file02%" /q >nul 2>nul
del "%file03%" /q >nul 2>nul
del "%file001%" /q >nul 2>nul
del "%file002%" /q >nul 2>nul
del "%LOCF%" /q >nul 2>nul
del "%LOIAF%" /q >nul 2>nul
goto :eof

:del_files2
del "%ISListf%" /q >nul 2>nul
del "%LOIAOCF%" /q >nul 2>nul
goto :eof




:: 判断注册表是否已加锁
:chk_reg_lock
set "oid=N/A" &set "nid=N/A"
for /f "skip=1 tokens=1,2,*" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId 2^>nul') do set "oid=%%k"
if "%oid%" neq "N/A" (goto :eof)
call :unlock_reg
goto :eof

:: 解封注册表
:unlock_reg
echo [Version] >%inff%
echo Signature=$CHICAGO$ >>%inff%
echo [DefaultInstall] >>%inff%
echo DelReg=del >>%inff%
echo [del] >>%inff%
echo HKCU,Software\Microsoft\Windows\CurrentVersion\Policies\System,Disableregistrytools >>%inff%
rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 %inff%
del %inff% /q >nul
for /f "skip=1 tokens=1,2,*" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId 2^>nul') do set "oid=%%k"
if "%oid%" == "N/A" (color 47 &echo.&echo.&echo 注册表已封锁,脚本不能执行。&ping.exe -n 8 127.0.0.1 >nul&goto end)
set "Disableregistrytools=120"
goto :eof

:: 判断注册表是否需加锁
:chk_reg_unlock
if "%Disableregistrytools%" neq "120" (goto :eof)
call :lock_reg
goto :eof

:: 封锁注册表
:lock_reg
echo Windows Registry Editor Version 5.00>%regf%
echo.>>%regf%
echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]>>%regf%
echo "DisableRegistryTools"=dword:00000001>>%regf%
regedit /s %regf%
del %regf% /q >nul
goto :eof


:: 使用WMIC命令取获取已安装程序列表
:wmic_get_applist
call :date_time
set "time1=%current_date% %current_time%"
call :del_files1
cls&echo%line1%&echo%lb%&echo%line1%
echo 正在通过 WMIC 查询取已安装程序 ...
wmic /output:%file1% product get name
echo 正在删除非 ANSI 编码及每行右侧空格 ...
findstr /v /r /i "Name " "%file1%" > "%file2%"
type "%file2%" >"%file1%"
call :del_right_left_sp_per_row2 "%file1%" "%file002%"
for /f "tokens=3 delims= " %%i in ('find /v /c "" "%file002%" ') do (set "n_app1=%%i")
echo 正在处理忽略清单 ...
call :Ignored_Apps
for /f "tokens=3 delims= " %%i in ('find /v /c "" "%file002%" ') do (set "n_app2=%%i")
set /a n_app3=%n_app1% - %n_app2%
ren "%file002%" "InstalledSoftwareList.txt"
call :Apps_Of_Concerns
if exist "%LOIAOCF%" (Explorer "%LOIAOCF%")
call :del_files1
call :date_time
set "time2=%current_date% %current_time%"
call :time_interval time_interval_val "%time1%" "%time2%"
echo.
if %n_app3% equ 0 (set "info2=。") else ( set "info2=,其中 %n_app3% 个应用未予显示。")
if %isllocn% equ 0 (set "info3=。") else ( set "info3=,其中 %isllocn% 个应用请予关注。")
echo 查询到已安装应用 %n_app1% 个%info2%
echo 呈现给您的应用为 %n_app2% 个%info3%
echo 用时 %time_interval_val% 秒。按任意键退出。
if %n_app2% neq 0 Explorer "%ISListf%"
goto :eof


:: 使用WMIC命令取获取已安装程序列表-删除文本文件每行两侧空格-删除第一行列名
:del_right_left_sp_per_row2
set input_file0=%1
set output_file0=%2
set input_file0=%input_file0:~1,-1%
set output_file0=%output_file0:~1,-1%
del "%output_file0%" /q >nul 2>nul
for /f "skip=1 tokens=1* delims=" %%i in ('type "%input_file0%"') do (
set "tpt=%%i"
call :del_right_left_sp
echo !tpt!>>"%output_file0%"
)
del "%input_file0%" /q >nul 2>nul
goto :eof


:: 忽略名单
:Ignored_Apps
:::::::::::::::::::::::::::::::::::::
cd.>%LOIAF%
echo Microsoft>>%LOIAF%
echo Windows 驱动程序包>>%LOIAF%
echo 火绒安全软件>>%LOIAF%
echo 搜狗拼音输入法 8.4正式版>>%LOIAF%
echo WinRAR 5.40 (32-位)>>%LOIAF%
echo 百度网盘>>%LOIAF%

:::::::::::::::::::::::::::::::::::::

for /f "tokens=1* delims=" %%i in ('type %LOIAF% ' ) do (
set "Ignored_App=%%i"
findstr /v /r /i "!Ignored_App!" "%file002%" > "%file001%"
type "%file001%" > "%file002%"
)
goto :eof



:: 关注名单
:Apps_Of_Concerns
:::::::::::::::::::::::::::::::::::::
cd.>%LOCF%
echo Google Chrome>>%LOCF%
echo Notepad++ (32-bit x86)>>%LOCF%
echo 爱奇艺视频>>%LOCF%
echo 火绒安全软件>>%LOCF%
echo SSDT 必备组件>>%LOCF%

:::::::::::::::::::::::::::::::::::::

echo 以下应用请予关注>%LOIAOCF%
echo ======================================>>%LOIAOCF%
for /f "tokens=1* delims=" %%i in ('type "%LOCF%" ' ) do (
set "App_Of_Concerns=%%i"
findstr /c:"!App_Of_Concerns!" "%ISListf%" >>%LOIAOCF% 2>nul)
for /f "tokens=3 delims= " %%i in ('find /v /c "" "%LOIAOCF%" ') do (set "isllocn=%%i")
set /a isllocn=%isllocn% - 2
if %isllocn% equ 0 del %LOIAOCF% /q >nul 2>nul
goto :eof

:end
rem del "%ISListf%" /q >nul 2>nul
rem del "%LOIAOCF%" /q >nul 2>nul

统计脚本参考原链接:https://blog.csdn.net/yanchenyu365/article/details/90753032

-------------本文结束感谢您的阅读-------------