Add missing scripts

This commit is contained in:
2025-01-19 16:07:46 +01:00
parent f3d3a8472e
commit 9706917679
2 changed files with 126 additions and 0 deletions

29
uninstall_agent.cmd Normal file
View File

@@ -0,0 +1,29 @@
@echo off
setlocal
cd /D "%~dp0"
echo This script uninstalls the Beszel agent
echo.
call env.cmd
echo Checking adminstrative rights
rem from https://stackoverflow.com/questions/7985755/how-to-detect-if-cmd-is-running-as-administrator-has-elevated-privileges
net session >nul 2>&1
if %errorlevel% equ 0 (
echo Administrative rights check OK
) else (
echo You are NOT Administrator. Start the script from an administrative cmd.exe shell...
goto end
)
echo Stopping Beszel agent service
%NSSMEXE% stop %SERVICENAME% >nul 2>&1
echo Removing Beszel agent service
%NSSMEXE% remove %SERVICENAME% >nul 2>&1
echo Deleting installation directory
rd /q/s %DESTINATIONDIR% >nul 2>&1
:end
ech Done.