-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathWindows-One-Click-Uninstall.bat
More file actions
79 lines (67 loc) · 2.81 KB
/
Windows-One-Click-Uninstall.bat
File metadata and controls
79 lines (67 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@echo off
setlocal enabledelayedexpansion
:: =======================================================
:: Check for Administrator Privileges
:: =======================================================
NET SESSION >nul 2>&1
if %errorlevel% neq 0 (
echo #######################################################
echo # ERROR: PLEASE RUN THIS SCRIPT AS ADMINISTRATOR! #
echo # Right-click -> Run as Administrator #
echo #######################################################
timeout /t 5
exit /b 1
)
:: =======================================================
:: Configuration
:: =======================================================
set TASK_NAME="NCUT Auto Login"
set INSTALL_DIR=%ProgramData%\NCUT_AutoLogin
set LEGACY_STARTUP="%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup\NCUT_Internet_Auto_Login.py"
echo =======================================================
echo Uninstalling NCUT Auto Login Script...
echo =======================================================
:: =======================================================
:: Step 1: Remove Scheduled Task
:: =======================================================
echo [1/3] Removing system scheduled task...
:: Attempt to stop the task if it is running
schtasks /end /tn %TASK_NAME% >nul 2>&1
:: Delete the task
schtasks /delete /tn %TASK_NAME% /f >nul 2>&1
if %errorlevel% equ 0 (
echo - Scheduled task deleted successfully.
) else (
echo - Scheduled task not found or already deleted.
)
:: =======================================================
:: Step 2: Remove Files and Directory
:: =======================================================
echo [2/3] Removing script files...
if exist "%INSTALL_DIR%" (
rmdir /s /q "%INSTALL_DIR%"
echo - Removed installation directory: %INSTALL_DIR%
) else (
echo - Installation directory not found, skipping.
)
:: =======================================================
:: Step 3: Cleanup Legacy Startup Items
:: =======================================================
echo [3/3] Checking for legacy startup items...
if exist %LEGACY_STARTUP% (
del /f /q %LEGACY_STARTUP%
echo - Removed script from legacy Startup folder.
)
echo.
echo #######################################################
echo # UNINSTALLATION COMPLETED! #
echo # #
echo # - Auto-login task cancelled #
echo # - Script files removed #
echo # #
echo # NOTE: Python and 'requests' package remain #
echo # installed on your system. #
echo # (To avoid affecting other Python applications) #
echo #######################################################
timeout /t 5
exit /b 0