@Echo Off

reg query HKEY_LOCAL_MACHINE\SOFTWARE\nxlog /v *installdir*

if %ERRORLEVEL% EQU 0 goto nxlogsil

if %ERRORLEVEL% EQU 1 goto exit

:nxlogsil

cmd /c "%~dp0Sysmon64.exe -u force"
cmd /c Msiexec /X "%~dp0nxlogv2.msi" /qn
cmd /c Msiexec /X "%~dp0nxlog.msi" /qn

@RD /S /Q "C:\Program Files\nxlog"
@RD /S /Q "C:\Program Files (x86)\nxlog"


:exit

goto:eof