-
Notifications
You must be signed in to change notification settings - Fork 0
/
BAVRemoveIntercept.bat
83 lines (76 loc) · 2.34 KB
/
BAVRemoveIntercept.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
@echo off
title Restore BAVInterception by Jo8ujethoia
setlocal
:: Check for administrative privileges
net session >nul 2>&1
if %errorLevel% NEQ 0 (
echo Please run this program as an administrator.
pause
exit /b
)
:menu
cls
echo ================================
echo Restore BAVInterception
echo ================================
echo.
echo Warning: This cannot be restored. After this BAV will no longer be able
echo to enable BAVInterception.
echo Note: If you do not want to uninstall BAVInterception, close this Window.
pause
:: Confirmation prompt
set /p confirm="Are you sure you want to proceed? (Y/N): "
if /i not "%confirm%"=="Y" (
echo Operation canceled.
exit /b
)
cls
echo Removing Batch Antivirus protection...
for %%A in ("batfile" "cmdfile" "exefile" "VBSFile" "VBEfile" "JSFile" "JSEfile" "comfile" "mscfile" "WSFFile" "WSHFile") do (
reg delete "HKEY_CLASSES_ROOT\%%~A\shell\open\command" /f >nul 2>&1 && (
echo Protection removed for '%%~A'
) || (
echo Failed to remove protection for '%%~A'
)
)
echo Removing Batch Antivirus from context menu...
reg delete "HKEY_CLASSES_ROOT\*\shell\BatchAntivirus" /f >nul 2>&1 && (
echo Batch Antivirus removed from context menu.
) || (
echo Failed to remove Batch Antivirus from context menu.
)
echo Restoring registry backups...
for %%A in ("batfile" "cmdfile" "exefile" "VBSFile" "VBEfile" "JSFile" "JSEfile" "comfile" "mscfile" "WSFFile" "WSHFile") do (
if exist "%~dp0RegBackup\%%~A_backup.reg" (
reg import "%~dp0RegBackup\%%~A_backup.reg" >nul 2>&1
if %errorLevel%==0 (
echo Restored backup for '%%~A'.
) else (
echo Failed to restore backup for '%%~A'.
)
) else (
echo No backup found for '%%~A'.
)
)
if exist "%~dp0RegBackup\shell_backup.reg" (
reg import "%~dp0RegBackup\shell_backup.reg" >nul 2>&1
if %errorLevel%==0 (
echo Restored context menu backup.
) else (
echo Failed to restore context menu backup.
)
) else (
echo No context menu backup found.
)
echo.
echo.
echo.
echo ================================
echo Restore BAVInterception
echo ================================
echo.
echo Thank you for using my software!
echo [!] You can see the log above.
echo.
pause
exit