main.bat
1 @echo off 2 color 0a 3 title Refresh Baidu Zhidao Evaluate Num 2.0 4 rem Supported: iexplore.exe/firefox.exe 5 set BROWSER_IMAGENAME=iexplore.exe 6 if "%BROWSER_IMAGENAME%" equ "iexplore.exe" ( 7 set BROWSER_PATH_NAME=C:Program FilesInternet Exploreriexplore.exe 8 set BROWSER_DEFAULT_PARAMS= 9 set BEFORE_BROWSER_EXITS=CLEAR_IE 10 ) else if "%BROWSER_IMAGENAME%" equ "firefox.exe" ( 11 set BROWSER_PATH_NAME=C:Program FilesMozilla Firefoxfirefox.exe 12 set BROWSER_DEFAULT_PARAMS=-private-window 13 set BEFORE_BROWSER_EXITS=CLEAR_FF 14 ) else ( 15 echo It is an unsupported browser. 16 goto :NORMAL_EXIT 17 ) 18 set "CS_1=INFO: No tasks are running which match the specified criteria." 19 echo 注意:接下来将自动强制结束所有进程%BROWSER_IMAGENAME%,如果存在进程%BROWSER_IMAGENAME%,可能会导致该程序无休止的启动任务。 20 pause 21 cls 22 rem default 23 set QUESTION_URL=https://zhidao.baidu.com/question/77631336.html 24 set /p QUESTION_URL=Question url: 25 call :KILL_BROWSER 26 for /l %%i in (0 0 0) do ( 27 echo Running... 28 start "*_`" "%BROWSER_PATH_NAME%" %BROWSER_DEFAULT_PARAMS% %QUESTION_URL% 29 cls 30 echo Waiting... 31 choice /c Ot /n /cs /t 6 /d O 32 cls 33 echo Cleaning up... 34 call :%BEFORE_BROWSER_EXITS% 35 cls 36 echo Exiting... 37 call :KILL_BROWSER 38 cls 39 ) 40 41 :CLEAR_IE 42 rem Clear88571 43 rundll32.exe inetcpl.cpl,ClearMyTracksByProcess Flags: 88571 44 goto :EOF 45 46 :KILL_BROWSER 47 for /f "tokens=*" %%m in ('tasklist /nh /fi "imagename eq %BROWSER_IMAGENAME%"') do ( 48 if "%%m" neq "%CS_1%" ( 49 for /f "tokens=2" %%x in ("%%m") do ( 50 echo kill %%x 51 taskkill /f /pid %%x 52 ) 53 ) 54 ) 55 goto :EOF 56 57 :NORMAL_EXIT 58 pause 59 exit
附件1