Skip to content

Instantly share code, notes, and snippets.

@CarissaDurko
Created July 7, 2025 19:03
Show Gist options
  • Select an option

  • Save CarissaDurko/28c3b7a79a1bf5b4eaeb3d86db6f34da to your computer and use it in GitHub Desktop.

Select an option

Save CarissaDurko/28c3b7a79a1bf5b4eaeb3d86db6f34da to your computer and use it in GitHub Desktop.
Tenable Uninstall Batch File
@echo off
REM -----------------------------------------------
REM Uninstall-Tenable.bat
REM Stops the Tenable/Nessus service and uninstalls the MSI
REM -----------------------------------------------
REM 1) Stop the Tenable/Nessus service (adjust the name if needed)
set SERVICE="Tenable Nessus Agent"
REM 2) Define GUIDS if needed for hardcoding
set GUID1={Enter Guid Here}
REM 3) Stop Service
echo stopping the service %SERVICE%...
net stop %SERVICE%
REM 4) check if service is running
sc query %SERVICE% | find "STOPPED"
if %errorlevel%==0 (
echo Service %SERVICE% stopped successfully.
)
else (
echo Failed to stop service %SERVICE%. Exiting...
pause
exit /b 1
)
REM 5) Silent uninstall of the MSI by GUID
msiexec.exe /x {GUID} /qn /norestart
REM 6) Deletes the service
echo Deleting service %SERVICE%..
sc delete %SERVICE%
REM 7) Exits service
echo Done.
pause
exit /b 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment