ECHO Off
cd /d "%~dp0"
SETLOCAL enableextensions

SET ChromRegKey="HKLM\SOFTWARE\Dionex\Chromeleon\7"
SET ChromRegValue="InstDir"

REM Use the 32 bit version of REG as the key is a 32 bit key
IF %PROCESSOR_ARCHITECTURE% == AMD64 (
	SET REGEXE=%SystemRoot%\SysWOW64\reg.exe
) else (
	SET REGEXE=%SystemRoot%\system32\reg.exe               
)
REM Read the install path from the registry
FOR /F "tokens=1,2*" %%A IN ('%REGEXE% query "%ChromRegKey%" /v "%ChromRegValue%"') DO (
        SET ChromeleonPath="%%C"
)

if defined ChromeleonPath (
	CD %ChromeleonPath%
	CD bin
	PowerShell -NoProfile -ExecutionPolicy Bypass -Command "dir | Unblock-File"
    ECHO Hotfix Unblocked
) else (
    ECHO Could not determine Chromeleon 7 install path. Is Chromeleon 7 installed?
)
pause
 