-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
uninstall.bat
93 lines (74 loc) · 2.31 KB
/
uninstall.bat
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@echo off
setlocal enabledelayedexpansion
:: Check if we're running in SysWOW64
if /i "%PROCESSOR_ARCHITECTURE%"=="x86" (
if defined PROCESSOR_ARCHITEW6432 (
:: We're running in 32-bit mode on a 64-bit system
:: Re-launch using 64-bit cmd.exe
%SystemRoot%\Sysnative\cmd.exe /c "%~dpnx0" %*
exit /b
)
)
:: At this point, we're running in 64-bit mode
:: Check if the script is being run directly or through another cmd instance
if /i "%~dp0"=="%SystemRoot%\SysWOW64\" (
:: We're running from SysWOW64, re-launch using System32 cmd.exe
%SystemRoot%\System32\cmd.exe /c "%~dpnx0" %*
exit /b
)
@REM run as admin
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
echo =========================================================================
echo.
echo ABUS Uninstaller [Version 3.0]
echo contact: [email protected]
echo.
echo =========================================================================
echo.
:: If we've reached here, we're running in the correct environment
:: Your actual batch file commands start here
echo Running in 64-bit mode from System32
echo Current directory: %CD%
echo Command line: %*
cd /D "%~dp0"
:: quit task
choice /C YN /N /T 10 /D Y /M "Terminate all running python.exe. Do you want to continue (Y/N)?"
if errorlevel 2 (
echo.
echo Quit Uninstallation.
pause
exit 0
)
taskkill /f /im python.exe /t
echo.
echo.
choice /C NY /N /T 10 /D N /M "Would you like to remove system packages (not recommended) (N/Y)?"
if errorlevel 2 (
echo.
echo Start Uninstallation.
:: Uninstall packages
choco uninstall -y git.install
choco uninstall -y ffmpeg
@REM choco uninstall -y cuda --version=11.8.0.52206
@REM choco uninstall -y cuda --version=12.3.2.546
choco uninstall -y cuda
choco uninstall -y visualstudio2022-workload-vctools
choco uninstall -y visualstudio2022buildtools
)
:: remove folder
if exist "%~dp0\installer_files\" (
echo Deleting installer_files folder ...
echo Please wait a moment
rmdir /s /q "%~dp0\installer_files"
)
echo ABUS uninstall.bat finished.
pause
:: Rebooting
for /l %%i in (30,-1,1) do (
cls
echo.
echo ABUS Uninstaller finished.
echo System will be rebooted in %%i seconds.
timeout /t 1 /nobreak >nul
)
shutdown /r /t 0