@ECHO OFF&(PUSHD "%~DP0")

taskkill /f /im EAV_NT* /t
taskkill /f /im BootHelper.exe

:: 脱机许可证密钥激活文件(license.lf)//不能直接导入用
rd/s/q "%ProgramData%\ESET\ESET Security\Installer"
echo f|copy /y license.lf "%ProgramData%\ESET\ESET Security\License"

echo HKLM\SOFTWARE\ESET\ESET Security [1 7 17] >reglimits.ini
if exist "%WinDir%\System32\regini.exe" regini reglimits.ini & del reglimits.ini
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice" /f /v "Hash" >NUL 2>NUL
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.PDF\UserChoice" /f /v "Progid" >NUL 2>NUL

:: 用户名密码密钥激活信息相关键值
reg delete "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000400\settings\AcceptedEulas\a1002" /f
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Info" /f /v "WebActivationState" /t REG_DWORD /d "257"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000006\settings\Ekrn\Check" /f /v "PromoCodesTime" /t REG_DWORD /d "1598851535"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000006\settings\Ekrn\Info" /f /v "ActivationState" /t REG_DWORD /d "1"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000006\settings\Ekrn\Info" /f /v "ActivationType" /t REG_DWORD /d "256"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000006\settings\Ekrn\Info" /f /v "LastLicenseWarning" /t REG_DWORD /d "1598851530"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000400\settings\AcceptedEulas\ce_meta\strbufs" /f /v "DocumentHash" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000400\settings\AcceptedEulas\ce_meta\strbufs" /f /v "CollectionHash" /t REG_DWORD /d "0"

reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000400\settings" /f /v "Username" /t REG_BINARY /d "4541562d30323830313736323738"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\plugins\01000400\settings" /f /v "Password" /t REG_BINARY /d "58d6e1e9bcf08ff2696456ad81c86c75df3149bc"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\ConfigBackup" /f /v "Username" /d "EAV-0280176278"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\ConfigBackup" /f /v "Password" /t REG_BINARY /d "58d6e1e9bcf08ff2696456ad81c86c75df3149bc"

:: 禁用反馈系统（ESET LiveGrid）
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\Settings\LiveGrid" /f /v "SubmitStatistics" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\Settings\LiveGrid" /f /v "SubmitCrashReports" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\Settings\LiveGrid" /f /v "SubmitInfectedFiles" /t REG_DWORD /d "2"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\Settings\LiveGrid" /f /v "SubmitSuspiciousOther" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\Settings\LiveGrid" /f /v "SubmitSuspiciousScripts" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\Settings\LiveGrid" /f /v "SubmitSuspiciousArchives" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\Settings\LiveGrid" /f /v "SubmitSuspiciousExecutables" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\gui\UI_CONFIG\ApplicationStatuses\EkrnLiveGridDisabled" /f /v "Show" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\gui\UI_CONFIG\ApplicationStatuses\EkrnLiveGridDisabled" /f /v "Send" /t REG_DWORD /d "1"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\gui\UI_CONFIG\ApplicationStatuses\ParentalPaused" /f /v "Show" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\gui\UI_CONFIG\ApplicationStatuses\ParentalNonfunct" /f /v "Show" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\gui\UI_CONFIG\ApplicationStatuses\ParentalNotAuthorized" /f /v "Show" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\gui\UI_CONFIG\ApplicationStatuses\PerseusLiveGridNotWorking" /f /v "Show" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Config\gui\UI_CONFIG\ApplicationStatuses\PerseusLiveGridNotWorking" /f /v "Send" /t REG_DWORD /d "1"

:: 替换内置更新服务器VC52
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "FailSafeServer" /d "http://w.u.5dmx.com/eset/v13/"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "DefaultServerCount" /t REG_DWORD /d "2"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "InstallTime" /t REG_DWORD /d "1598851528"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastBackupTime" /t REG_DWORD /d "1598851532"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastAcceptedEulaCollection" /d ""
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastUpdateAttempt" /t REG_DWORD /d "1587212900"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastUpdate" /t REG_DWORD /d "1587212900"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastUpdateFailures" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastUpdateRetval" /t REG_DWORD /d "0"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastSuccessfulUpdate" /t REG_DWORD /d "1587212901"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastAppUpdateCheck" /t REG_DWORD /d "1587212902"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "DefaultServer0" /d "http://w.u.5dmx.com/eset/v13/dll/"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "DefaultServerWeight1" /t REG_DWORD /d "10"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "DefaultServer1" /d "http://zhiyin.f3322.net:2221/dll/"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "DefaultServerWeight3" /t REG_DWORD /d "100000"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "LastAcceptedEulaDocument" /d ""
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "VerFileETAG_zhiyin.f3322.net:2221/dll/update.ver" /d 
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Settings" /f /v "VerFileLastModified_zhiyin.f3322.net:2221/dll/update.ver"
reg add "HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000800\settings" /f /v "OutlookIntegrationChangeCounter" /t REG_DWORD /d "563241855"

ECHO.&ECHO 完成，即将重启系统 &TIMEOUT /t 1 >NUL&Shutdown -r -t 5