@if (true == false) @end /*
@echo off
chcp 1255>nul
setlocal EnableExtensions
setlocal EnableDelayedExpansion
color 1F
pushd "%~dp0"
if defined programfiles(x86) (
set "bitos=64"
set "reg64=/reg:64"
) else (
set "bitos=32"
)
set "ESET_Reg=HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion"
::goto label from arguments
if /i "%1"=="goto" if not "%2"=="" shift /2 & shift /1 & goto :%2
::commands without admin here
tasklist /v /fi "IMAGENAME eq msiexec.exe" | find "ESET" 1>nul 2>&1 && exit /b
::check if installed ESET & not home product
reg query "%ESET_Reg%\Info" /v ProductACodeStr | find "home" 1>nul 2>&1 || (
call :echoOtherProduct
exit /b
)
::check if installed 'ESET Internet Security' or others
for /f "tokens=1,2,*" %%A IN (
'reg query "%ESET_Reg%\Info" /v ProductName %reg64% 2^>nul'
) do set "product=%%C"
::get installers GUID for the aperation
for /f "tokens=1,2,*" %%D IN (
'reg query "%ESET_Reg%\Info" /v ProductCode %reg64%'
) do set InstallerGUID=%%F
::hidden run check
:hidden
if not "%1"=="hidden" cscript //nologo "%~f0" //e:javascript %comspec% "" 0 /c '"%~f0"' hidden %* & exit /b
shift /1
::Check self elevating run
if "%~1"=="admin" shift /1 & goto :selfadmincheck
::Check admin permissions
reg query "HKU\S-1-5-19" >NUL 2>&1 && goto :admin
::Running this script elevated
cscript //nologo "%~f0" //e:javascript %comspec% runas 0 /c '"%~f0"' hidden admin & exit /b
::Check admin permissions in self elevated run
:selfadmincheck
reg query "HKU\S-1-5-19" >NUL 2>&1 && goto :admin
echo Error self elevating the script, please run as admin manually.
echo Press any key to exit.
pause >nul
exit /b
:admin
::commands for admin here
goto :logger
:logging
prompt ESET_Ressetter$g
::goto label from arguments
if /i "%1"=="goto" if not "%2"=="" shift /2 & shift /1 & goto :%2
::Reset with no running eset (for running in Safe-Mode)
tasklist /fi "IMAGENAME eq ekrn.exe" | find "ekrn.exe" || (
call :reset_reg
goto :finish
)
::ESET repair for shutting down ESET
start msiexec /fm %InstallerGUID% /norestart /qr
timeout 3 >nul
tasklist /v /fi "IMAGENAME eq msiexec.exe" | find "ESET" || (
timeout 3 >nul
tasklist /v /fi "IMAGENAME eq msiexec.exe" | find "ESET" || exit /b
)
:ESET_shut_down
tasklist /fi "IMAGENAME eq ekrn.exe" | find "ekrn.exe" && (
timeout 1 >nul
goto :ESET_shut_down
)
::Reset 1
call :reset_reg
:Resetter_check
::ReReset if the reg was rewritten
tasklist /v /fi "IMAGENAME eq msiexec.exe" | find "ESET" 1>nul 2>&1 || goto :finish
reg query "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v ActivationType %reg64% 2>nul && (
call :reset_reg
)
reg query "%ESET_Reg%\Config\plugins\01000600\settings\DistPackage\AppSettings" /v ActOptions %reg64% | find "0x15" >nul || (
call :reset_reg
)
timeout 0 >nul
goto :Resetter_check
:finish
reg query "%ESET_Reg%\Info" /v WebActivationState %reg64%
reg query "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v ActivationType %reg64%
reg query "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v ActivationState %reg64% || (
reg query "%ESET_Reg%\Config\plugins\01000600\settings\DistPackage\AppSettings" /v "ActOptions" %reg64% | find "0x15" && (
cscript //nologo "%~f0" //e:javascript %comspec% "" 1 /c '"%~f0"' goto echoReset
goto :eof
)
)
echo exiting...
exit /b
:reset_reg
::deactivate
reg delete "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v "ActivationState" /f %reg64%
reg delete "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v "ActivationType" /f %reg64%
::enable trial activation
reg add "%ESET_Reg%\Config\plugins\01000600\settings\DistPackage\AppSettings" /v "ActOptions" /t reg_dword /d 0x00000015 /f %reg64%
::90 day coupon
if "%product%"=="ESET Internet Security" (
reg add "%ESET_Reg%\Config\plugins\01000600\settings\DistPackage" /v "DistSettings" /t reg_binary /d 3c446973747269627574696f6e53657474696e67733e0a093c506172746e657249643e3130343c2f506172746e657249643e0a093c436f756e747279436f64653e44453c2f436f756e747279436f64653e0a3c2f446973747269627574696f6e53657474696e67733e0a /f %reg64%
reg add "%ESET_Reg%\Config\plugins\01000600\settings\DistPackage\AppSettings" /v "DealCode" /t reg_binary /d 323039 /f %reg64%
)
reg delete "%ESET_Reg%\Info" /v "WebActivationState" /f %reg64%
goto :eof
:echoOtherProduct
echo Trial Reset works only on a installed ESET Home Product
timeout 5
goto :eof
:echoReset
echo Reset done successfully.
timeout 5
goto :eof
:logger
@echo on
call :logging >"%~dp0~%~n0.log" 2>&1
timeout 5
del /F /Q "%~dp0~%~n0.log" >nul
exit /b
: end of batch */
var command = WScript.Arguments.Item(0);
var elevate = WScript.Arguments.Item(1);
var showWindow = WScript.Arguments.Item(2);
var argument = "";
for (var i = 3; i < WScript.Arguments.Count(); ++i){
argument += WScript.Arguments.Item(i) + " ";
}
var argument = argument.replace(/\'/g, "\"");
var shellapp = new ActiveXObject("Shell.Application");
if (showWindow == "0"){
shellapp.ShellExecute(command, argument, null, elevate, 0);
}
if (showWindow == "1"){
shellapp.ShellExecute(command, argument, null, elevate, 1);
}