-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathuninstall_moneroocean_miner.bat
59 lines (42 loc) · 1.35 KB
/
uninstall_moneroocean_miner.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
@echo off
set VERSION=1.0
rem printing greetings
echo MoneroOcean mining uninstall script v%VERSION%.
echo ^(please report issues to [email protected] email^)
echo.
net session >nul 2>&1
if %errorLevel% == 0 (set ADMIN=1) else (set ADMIN=0)
if ["%USERPROFILE%"] == [""] (
echo ERROR: Please define USERPROFILE environment variable to your user directory
exit /b 1
)
if not exist "%USERPROFILE%" (
echo ERROR: Please make sure user directory %USERPROFILE% exists
exit /b 1
)
echo [*] Removing moneroocean miner
if %ADMIN% == 0 goto SKIP_ADMIN_PART
sc stop moneroocean_miner
sc delete moneroocean_miner
:SKIP_ADMIN_PART
taskkill /f /t /im xmrig.exe
if exist "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" (
set "STARTUP_DIR=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
goto STARTUP_DIR_OK
)
if exist "%USERPROFILE%\Start Menu\Programs\Startup" (
set "STARTUP_DIR=%USERPROFILE%\Start Menu\Programs\Startup"
goto STARTUP_DIR_OK
)
echo WARNING: Can't find Windows startup directory
goto REMOVE_DIR
:STARTUP_DIR_OK
del "%STARTUP_DIR%\moneroocean_miner.bat"
:REMOVE_DIR
echo [*] Removing "%USERPROFILE%\moneroocean" directory
timeout 5
rmdir /q /s "%USERPROFILE%\moneroocean" >NUL 2>NUL
IF EXIST "%USERPROFILE%\moneroocean" GOTO REMOVE_DIR
echo [*] Uninstall complete
pause
exit /b 0