Files
DevDrive/uninstall-service.bat

46 lines
855 B
Batchfile

@echo off
:: DevDrive Startup Task Uninstaller
:: Run as Administrator
setlocal
set TASK_NAME=DevDrive
echo Uninstalling %TASK_NAME%...
echo.
:: Check for admin privileges
net session >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: This script requires Administrator privileges.
echo Right-click and select "Run as administrator".
pause
exit /b 1
)
:: Check if task exists
schtasks /query /tn "%TASK_NAME%" >nul 2>&1
if %errorlevel% neq 0 (
echo Task %TASK_NAME% is not installed.
pause
exit /b 0
)
:: Kill running process
echo Stopping DevDrive...
taskkill /im DevDrive.exe /f >nul 2>&1
:: Delete task
echo Removing startup task...
schtasks /delete /tn "%TASK_NAME%" /f
if %errorlevel% neq 0 (
echo ERROR: Failed to remove task.
pause
exit /b 1
)
echo.
echo %TASK_NAME% uninstalled successfully!
echo.
pause