Broken computer screen

Script to remove LogMeIn

I wrote this script a few years ago and thought it might be useful to others.  I have to believe the difficulty in removing LogMeIn is intentional as there are few programs that randomize their installation GUID.  Anyway, this program may or may not still work depending on what the developers change with regard to uninstalling LogMeIn in the future.

This script searches the registry for the uninstall string to uninstall the application.  Deployment of this is up to you (Active Directory, SCCM, or some other means).

It logs to a file, RemoveLogMeIn.Log, and places it in the root of the computers system / OS drive.  You can modify the script to place that log elsewhere.  It should work on XP and up 32/64 bit.

Please email me letting me know if this works for you, sometimes I don’t know if what I post helps anyone!  bwilliams@iqspiral.com

@ECHO OFF
::bwilliams@iqspiral.com
::Version 1.03

SET _LOG=%systemdrive%\RemoveLogMeIn.Log
SET _STRING=LOGMEIN
SET _ARCH=%PROCESSOR_ARCHITECTURE%

IF EXIST %_LOG% DEL /Q %_LOG%

IF DEFINED PROCESSOR_ARCHITEW6432 SET _ARCH=%PROCESSOR_ARCHITEW6432%
CALL :LOG %_ARCH%

CALL :LOG Determining Architecture and setting registry target...
IF /I "%_ARCH%" EQU "AMD64" (
        SET _REG="HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
		) ELSE (
		SET _REG="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
		)
		
CALL :FINDAPPGUID %_STRING%

IF DEFINED _GUID (
	CALL :LOG Killing instances of LOGMEINSYSTRAY.EXE...
	TASKKILL /IM LOGMEINSYSTRAY.EXE /F >NUL 2>Nul
	CALL :LOG Removing %_String% using MSIEXEC.EXE /X{%_GUID%} /QN
	MSIEXEC.EXE /X{%_GUID%} /QN
	) ELSE (
	CALL :LOG Software does not exist on this system...nothing to do
	GOTO :END
	)

CALL :LOG Checking to ensure application is removed...
CALL :FINDAPPGUID %_STRING%

IF NOT DEFINED _GUID (
   CALL :LOG Application successfully removed
   ) ELSE (
   CALL :LOG Application failed to remove, ERROR
   )

GOTO :END   
	
:FINDAPPGUID
    SET _STRING=%1
	SET _GUID=
    FOR /F "TOKENS=*" %%A IN ('REG QUERY %_REG%') DO (
		REG QUERY "%%A" 2>NUL |FIND /I "%_STRING%">NUL 2>NUL && (
            ECHO %%A
			FOR /F "TOKENS=2 DELIMS={}" %%B IN ('REG QUERY "%%A"^|FIND /I "UNINSTALLSTRING"') DO SET _GUID=%%B
			)
		)
	GOTO :EOF

:LOG
   ECHO %DATE% %TIME% %*
   ECHO %DATE% %TIME% %*>>%_LOG%
   GOTO :EOF   

:END
   CALL :LOG Script Execution Complete

 

0 0 votes
Article Rating
Posted in Uncategorized.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments