@if (true == false) @end /*
@echo off
chcp 1255>nul
setlocal EnableExtensions
setlocal EnableDelayedExpansion
color 1F
title ESET Trial Reset
::goto label from arguments
if /i "%~1"=="goto" if not "%~2"=="" shift /2 & shift /1 & goto :%~2
::run with cmd /k, so that the window should not close with an error
if not "%1"=="run" cmd /k "%~f0" run %* & exit /b
shift /1
tasklist /v /fi "IMAGENAME eq msiexec.exe" | find "ESET" 1>nul 2>&1 && goto :exit
::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 the script elevated
cscript //nologo "%~f0" //e:javascript %comspec% runas 1 /c ?"%~f0"? admin & goto :exit
::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 (Right click on the script ^> 'Run As Administrator'^).
echo Press any key to exit.
pause >nul
goto :exit
:admin
if defined ProgramFiles(x86) (
set "bitos=64"
set "reg64=/reg:64"
) else (
set "bitos=32"
)
set "ESET_Reg=HKLM\SOFTWARE\ESET\ESET Security\CurrentVersion"
::check that a 'ESET home' product is installed
reg query "%ESET_Reg%\Info" /v ProductACodeStr %reg64% 2>nul | find "home" 1>nul 2>&1 || (
color 4F
echo Trial Reset works only on a installed ESET Home Product.
echo Press any key to exit.
pause >nul
goto :exit
)
::check if installed 'EIS'
for /f "tokens=2,*" %%A IN (
'reg query "%ESET_Reg%\Info" /v ProductType %reg64%'
) do set "product=%%B"
::get ESET DataDir (license file)
for /f "tokens=2,*" %%C IN (
'reg query "%ESET_Reg%\Info" /v AppDataDir %reg64%'
) do set "EsetDataDir=%%D"
::get installers GUID for shutting-down process (if ESET is running)
for /f "tokens=2,*" %%E IN (
'reg query "%ESET_Reg%\Info" /v ProductCode %reg64%'
) do set Installer=%%F
::if ESET is running, compare installed version with msi version
tasklist /fi "IMAGENAME eq ekrn.exe" | find "ekrn.exe" >nul && (
for /f "tokens=3,4,* delims=. " %%G in (
'reg query "%ESET_Reg%\Info" /v ProductVersion %reg64%'
) do (
set "installed_version_main=%%G"
set "installed_version=%%G.%%H"
set "installed_version_full=%%G.%%H.%%I"
)
for /f "tokens=*" %%J in (
'reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products" /s /f %Installer% %reg64% 2^>nul ^| find /i "Products"'
) do for /f "tokens=3,4 delims=. " %%K in (
'reg query "%%J" /v DisplayVersion %reg64%'
) do set "msi_version=%%K.%%L"
if not "!installed_version!" == "!msi_version!" (
if exist "%~dp0ehs_nt%bitos%.msi" (
set Installer="%~dp0ehs_nt%bitos%.msi"
for /f "tokens=1,2 delims=." %%M in (
'powershell -nop -ep byPass -c $MSI^= get-item """"%~dp0ehs_nt%bitos%.msi""""^;$f^=([io.file]::ReadAllText(""""%~f0""""^)^) -split ':msi_productVersion\:.*'^;iex $f[1]'
) do (
set "msi_file_version=%%M.%%N"
set "echo_msi_file_version=MSI File Version=%%M.%%N"
)
)
) & if not "!installed_version!" == "!msi_file_version!" (
color 4F
echo Installed Version=!installed_version! MSI Version=!msi_version! !echo_msi_file_version!
echo The msi version does not match the installed version,
echo the script can't run in this case.
echo You can try to download it from the following link,
echo save it to the current folder ("%~dp0"^),
echo and run the resseter again.
echo (Or you can run the resseter from Safe-Mode^).
echo.
echo http://repository.eset.com/v1/com/eset/apps/home/security/windows/v!installed_version_main!/!installed_version_full!/ehs_nt%bitos%.msi
choice /m "Do you want to copy the link to the clipboard?"
if !errorlevel!==1 (
echo http://repository.eset.com/v1/com/eset/apps/home/security/windows/v!installed_version_main!/!installed_version_full!/ehs_nt%bitos%.msi | clip
echo Link was copied.
)
echo Press any key to exit.
pause >nul
goto :exit
)
)
echo Note: Your current license will be deleted and the license will not be recoverable^!
echo Press any key to continue . . .
pause >nul
::hidden run check
:hidden
if not "%~1"=="hidden" cscript //nologo "%~f0" //e:javascript %comspec% "" 0 /c ?"%~f0"? goto hidden hidden & goto :exit
shift /1
goto :logger
:logging
prompt ESET_Ressetter$g
::Reset with no running eset (ex: if running in Safe-Mode)
tasklist /fi "IMAGENAME eq ekrn.exe" | find "ekrn.exe" || (
if exist "%EsetDataDir%License\license.lf" del /f "%EsetDataDir%License\license.lf"
call :reset_reg
call :trial_reg
goto :finish
)
::ESET repair for shutting down ESET
start msiexec /fm %Installer% /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
)
:ESET_shut_down
if exist "%EsetDataDir%License\license.lf" (
del /f "%EsetDataDir%License\license.lf"
if exist "%EsetDataDir%License\license.lf" (
timeout 1 >nul
goto :ESET_shut_down
)
)
:Reset
reg add "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v "ActivationState" /t REG_DWORD /d "0" /f %reg64% 2>nul || (
timeout 1 >nul
goto :ESET_shut_down
)
call :reset_reg
call :trial_reg
:Resetter_check
::ReReset if the reg was ReWritten
reg query "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v ActivationState %reg64% 2>nul | find "0x0" >nul || (
call :reset_reg
)
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 :trial_reg
)
timeout 0 >nul
tasklist /v /fi "IMAGENAME eq msiexec.exe" | find "ESET" 1>nul 2>&1 || goto :finish
goto :Resetter_check
:finish
reg query "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v ActivationType %reg64%
if not exist "%EsetDataDir%License\license.lf" (
reg query "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v ActivationState %reg64% | find "0x0" && (
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
:reset_reg
reg add "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v "ActivationState" /t REG_DWORD /d "0" /f %reg64%
reg delete "%ESET_Reg%\Config\plugins\01000006\settings\Ekrn\Info" /v "ActivationType" /f %reg64%
goto :eof
:trial_reg
reg add "%ESET_Reg%\Config\plugins\01000600\settings\DistPackage\AppSettings" /v "ActOptions" /t reg_dword /d "21" /f %reg64%
::90 day coupon
if /i "%product%"=="eis" (
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%
)
goto :eof
:echoReset
echo Trial Reset done successfully.
timeout 5
exit /b
:logger
@echo on
call :logging >"%~dp0~%~n0.log" 2>&1
timeout 5
del /f /Q "%~dp0~%~n0.log" >nul
exit /b
:exit
for /f "tokens=2" %%A in ('tasklist /v /fi "IMAGENAME eq cmd.exe" ^| find "ESET Trial Reset"') do taskkill /PID %%A
goto :eof
:msi_productVersion: begin
$windowsInstaller = New-Object -com WindowsInstaller.Installer
$database = $windowsInstaller.GetType().InvokeMember("OpenDatabase", "InvokeMethod", $Null,$windowsInstaller, @($MSI.FullName, 0 ) )
$q = "SELECT Value FROM Property WHERE Property ='ProductVersion'"
$View = $database.GetType().InvokeMember("OpenView", "InvokeMethod", $Null, $database, ($q));$View.GetType().InvokeMember("Execute", "InvokeMethod", $Null, $View, $Null )
$record = $View.GetType().InvokeMember( "Fetch", "InvokeMethod", $Null, $View, $Null )
$version = $record.GetType().InvokeMember( "StringData", "GetProperty", $Null, $record, 1 )
return $version
:msi_productVersion: end
: 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);
}