C/C++教程

SoftCnKiller 更新程序 bat 调用vbs 更新,下载gitee文件 更新自身数据

本文主要是介绍SoftCnKiller 更新程序 bat 调用vbs 更新,下载gitee文件 更新自身数据,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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
这篇关于SoftCnKiller 更新程序 bat 调用vbs 更新,下载gitee文件 更新自身数据的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!