bat
@echo off
title 更新流氓軟件黑名單
cd /d "%~dp0"
echo 請選擇更新源,默認使用1、GitCode更新。
echo.&choice /C 12 /T 5 /D 1 /M "1、使用GitCode倉庫更新 2、使用Gitee倉庫更新"
if errorlevel 2 goto gitee
if errorlevel 1 goto gitcode
:gitcode
for /f "tokens=4,5 delims=. " %%i in ('ver') do if %%i%%j leq 62 (
echo.&echo 當前系統版本較低,更新WinHttp協議中以確保正常下載黑名單...
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v SecureProtocols /t REG_DWORD /d 2688 1>nul
reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings" /f /v SecureProtocols /t REG_DWORD /d 2688 1>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp" /f /v DefaultSecureProtocols /t REG_DWORD /d 2688 1>nul
reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp" /f /v DefaultSecureProtocols /t REG_DWORD /d 2688 1>nul
)
echo.&echo 使用GitCode更新...
wscript.exe -e:vbs data\GitCode更新名單.vbs
exit
:gitee
echo.&echo 使用Gitee更新...
wscript.exe -e:vbs data\Gitee更新名單.vbs
exit
vbs
currentfolder = CreateObject("Scripting.FileSystemObject").GetFolder(".").Path
Set fso=CreateObject("Scripting.FileSystemObject")
if fso.folderExists(currentfolder+"\data") then
downFile "https://gitee.com/softcnkiller/data/raw/master/whitepath.txt","\data\whitepath.txt"
downFile "https://gitee.com/softcnkiller/data/raw/master/AppdataInfo.txt","\data\AppdataInfo.txt"
downFile "https://gitee.com/softcnkiller/data/raw/master/folder.txt","\data\folder.txt"
downFile "https://gitee.com/softcnkiller/data/raw/master/sign.txt","\data\sign.txt"
downFile "https://gitee.com/softcnkiller/data/raw/master/Descrip/%E5%85%B3%E4%BA%8Efolder%E8%AF%B4%E6%98%8E.txt","\data\說明\關於folder說明.txt"
downFile "https://gitee.com/softcnkiller/data/raw/master/Descrip/%E5%85%B3%E4%BA%8E%E6%95%B0%E7%AD%BEsign%E8%AF%B4%E6%98%8E.txt","\data\說明\關於數簽sign說明.txt"
if fso.GetFile(currentfolder+"\data\sign.txt").size>100 and fso.GetFile(currentfolder+"\data\folder.txt").size>1000 and fso.GetFile(currentfolder+"\data\AppdataInfo.txt").size >400 then
msgbox "更新完成!"
else
msgbox "更新出錯,請切換更新源!或手動到網址下載:https://free.lanzoui.com/b0cpu1guf"
end if
else
msgbox "Data目錄不存在,請在軟件目錄下運行!"
end if
Sub downFile(url,path)
Set xHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
Set bStrm = CreateObject("Adodb.Stream")
xHttp.Open "GET", url, False
xHttp.Send
with bStrm
.type = 1 '
.open
.write xHttp.responseBody
.savetofile currentfolder+path, 2 '//覆蓋
end with
End Sub