Good morning, Dear community members, I would like your help to check the issue of a script I am using for the process of uninstalling and installing the Sophos enpoint.
I'm putting the script below, it's not working properly, plus the information was taken from the Sophos KB, can you help me make it functional for running this process in a script only?
------------------------------------------------- ------------------------------------------------- ---
@echo off if defined PROGRAMFILES(X86) ( GOTO X64 ) else ( GOTO X86 )
:X64 C:\Windows\System32\reg.exe query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Sophos\Remote Management System" >nul
IF %ERRORLEVEL% EQU 0 (GOTO REMOVE) ELSE (GOTO CHECK)
:X86 START C:\Windows\System32\reg.exe query "HKEY_LOCAL_MACHINE\SOFTWARE\Sophos\Remote Management System" >nul
IF %ERRORLEVEL% EQU 0 (GOTO REMOVE) ELSE (GOTO CHECK)
:CHECK tasklist | findstr SSPService.exe >nul
IF %ERRORLEVEL% EQU 0 (GOTO QUIT) ELSE (GOTO INSTALL)
: REMOVE
net stop "Sophos AutoUpdate Service"
net stop "Sophos Remote Management System"
net stop "Sophos Network Threat Protection"
net stop "Sophos Anti-Virus"
net stop "Sophos AutoUpdate"
net stop "Sophos Exploit Prevention"
net stop "Sophos Clean Service"
net stop "Sophos Patch Agent"
net stop "Sophos Endpoint Defense Service"
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SAVService" /t REG_DWORD /v Start /d 0x00000004 /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos MCS Agent" /t REG_DWORD /v Start /d 0x00000004 /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\TamperProtection\Config" /t REG_DWORD /v SAVEnabled /d 0 /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Sophos Endpoint Defense\TamperProtection\Config" /t REG_DWORD /v SEDEnabled /d 0 /f
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Sophos\SAVService\TamperProtection" /t REG_DWORD /v Enabled /d 0 /f
"C:\Program Files\Sophos\Clean\uninstall.exe"
"C:\Program Files\Sophos\Endpoint Defense\SEDuninstall.exe"
MsiExec.exe /X{1AC3C833-D493-460C-816F-D26F30F79DC3} /quiet
MsiExec.exe /X{2C7A82DB-69BC-4198-AC26-BB862F1BE4D0} /quiet
MsiExec.exe /X{58B983CB-BBFC-42B2-9C81-29351581C623} /quiet
MsiExec.exe /X{866151B2-E14E-40E0-B6D9-64B1D428F5CB} /quiet
MsiExec.exe /X{1093B57D-A613-47F3-90CF-0FD5C5DCFFE6} /quiet
MsiExec.exe /X{4B1F9009-CD85-43C0-BCBD-D491908D5A52} /quiet
MsiExec.exe /X{FED1005D-CBC8-45D5-A288-FFC7BB304121} /quiet
MsiExec.exe /X{AFBCA1B9-496C-4AE6-98AE-3EA1CFF65C54} /quiet
MsiExec.exe /X{DB73B743-1A96-4970-B681-B3649A34B34C} /quiet
"C:\Program Files\Sophos\Sophos Endpoint Agent\uninstallcli.exe" --quiet
START \\********\SophosInstall\SophosZap.exe --confirm
GOTO INSTALL
:INSTALL
START \\********\SophosInstall\SophosSetup.exe --quiet
:QUIT
exit
This thread was automatically locked due to age.