Last active
June 26, 2024 19:18
-
-
Save ph33nx/0ed14724213c4cc467c85826c9dca908 to your computer and use it in GitHub Desktop.
Block All Adobe .exe files via Firewall on Windows Using Batch Script | Stop adobe apps to access internet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@REM Author: https://github.com/ph33nx | |
@REM Description: This script blocks or unblocks Adobe-related executables in Windows Firewall. | |
@REM Usage: | |
@REM - To block executables: adobe_block.bat | |
@REM - To unblock (delete) existing rules: adobe_block.bat -delete | |
@echo off | |
setlocal enabledelayedexpansion | |
REM Check if the script should delete existing rules | |
if /i "%1"=="-delete" ( | |
echo Deleting existing firewall rules... | |
for /f "tokens=*" %%r in ('powershell -command "(Get-NetFirewallRule | where {$_.DisplayName -like '*adobe-block'}).DisplayName"') do ( | |
netsh advfirewall firewall delete rule name="%%r" | |
) | |
echo Firewall rules deleted successfully. | |
pause | |
goto :eof | |
) | |
REM Process each folder and block executables | |
if exist "C:\Program Files\Adobe" ( | |
for /R "C:\Program Files\Adobe" %%X in (*.exe) do ( | |
echo Blocking: %%~nX | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=out program="%%X" action=block | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=in program="%%X" action=block | |
) | |
) | |
if exist "C:\Program Files\Common Files\Adobe" ( | |
for /R "C:\Program Files\Common Files\Adobe" %%X in (*.exe) do ( | |
echo Blocking: %%~nX | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=out program="%%X" action=block | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=in program="%%X" action=block | |
) | |
) | |
if exist "C:\Program Files\Maxon Cinema 4D R25" ( | |
for /R "C:\Program Files\Maxon Cinema 4D R25" %%X in (*.exe) do ( | |
echo Blocking: %%~nX | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=out program="%%X" action=block | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=in program="%%X" action=block | |
) | |
) | |
if exist "C:\Program Files\Red Giant" ( | |
for /R "C:\Program Files\Red Giant" %%X in (*.exe) do ( | |
echo Blocking: %%~nX | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=out program="%%X" action=block | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=in program="%%X" action=block | |
) | |
) | |
if exist "C:\Program Files (x86)\Adobe" ( | |
for /R "C:\Program Files (x86)\Adobe" %%X in (*.exe) do ( | |
echo Blocking: %%~nX | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=out program="%%X" action=block | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=in program="%%X" action=block | |
) | |
) | |
if exist "C:\Program Files (x86)\Common Files\Adobe" ( | |
for /R "C:\Program Files (x86)\Common Files\Adobe" %%X in (*.exe) do ( | |
echo Blocking: %%~nX | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=out program="%%X" action=block | |
netsh advfirewall firewall add rule name="%%~nX adobe-block" dir=in program="%%X" action=block | |
) | |
) | |
echo Blocking completed. | |
pause | |
endlocal |
Do you have the code for Autodesk programs such as Autocad, Revit, Cine3d, Maya, 3dsMax...?
This is great, thanks for your effort!
Wow this is awesome. Thank you bruv!!
A maya autodesk, adobe acrobat version would be great too, there are so many adobe exes now AdskLicensingAgent.exe, AdskAccessServiceHost.exe, FNPLicensingService.exe, FNPLicensingService64.exe,
¡Hola! ¿Como puedo revertir el script? Gracias <3
Thank's great job, appreciate
For Autodesk:
@REM Author: https://github.com/ph33nx
@REM Description: This script blocks or unblocks Adobe-related executables in Windows Firewall.
@REM Usage:
@REM - To block executables: adobe_block.bat
@REM - To unblock (delete) existing rules: adobe_block.bat -delete
@echo off
setlocal enabledelayedexpansion
REM Check if the script should delete existing rules
if /i "%1"=="-delete" (
echo Deleting existing firewall rules...
for /f "tokens=*" %%r in ('powershell -command "(Get-NetFirewallRule | where {$_.DisplayName -like '*autodesk-block'}).DisplayName"') do (
netsh advfirewall firewall delete rule name="%%r"
)
echo Firewall rules deleted successfully.
pause
goto :eof
)
REM Process each folder and block executables
if exist "C:\Program Files\Autodesk" (
for /R "C:\Program Files\Autodesk" %%X in (*.exe) do (
echo Blocking: %%~nX
netsh advfirewall firewall add rule name="%%~nX autodesk-block" dir=out program="%%X" action=block
netsh advfirewall firewall add rule name="%%~nX autodesk-block" dir=in program="%%X" action=block
)
)
if exist "C:\Program Files (x86)\Common Files\Macrovision Shared" (
for /R "C:\Program Files (x86)\Common Files\Macrovision Shared" %%X in (*.exe) do (
echo Blocking: %%~nX
netsh advfirewall firewall add rule name="%%~nX autodesk-block" dir=out program="%%X" action=block
netsh advfirewall firewall add rule name="%%~nX autodesk-block" dir=in program="%%X" action=block
)
)
if exist "C:\Program Files (x86)\Common Files\Autodesk Shared" (
for /R "C:\Program Files (x86)\Common Files\Autodesk Shared" %%X in (*.exe) do (
echo Blocking: %%~nX
netsh advfirewall firewall add rule name="%%~nX autodesk-block" dir=out program="%%X" action=block
netsh advfirewall firewall add rule name="%%~nX autodesk-block" dir=in program="%%X" action=block
)
)
echo Blocking completed.
pause
endlocal
For Corel:
@REM Author: https://github.com/ph33nx
@REM Description: This script blocks or unblocks Adobe-related executables in Windows Firewall.
@REM Usage:
@REM - To block executables: adobe_block.bat
@REM - To unblock (delete) existing rules: adobe_block.bat -delete
@echo off
setlocal enabledelayedexpansion
REM Check if the script should delete existing rules
if /i "%1"=="-delete" (
echo Deleting existing firewall rules...
for /f "tokens=*" %%r in ('powershell -command "(Get-NetFirewallRule | where {$_.DisplayName -like '*Corel-block'}).DisplayName"') do (
netsh advfirewall firewall delete rule name="%%r"
)
echo Firewall rules deleted successfully.
pause
goto :eof
)
REM Process each folder and block executables
if exist "C:\Program Files\Corel" (
for /R "C:\Program Files\Corel" %%X in (*.exe) do (
echo Blocking: %%~nX
netsh advfirewall firewall add rule name="%%~nX Corel-block" dir=out program="%%X" action=block
netsh advfirewall firewall add rule name="%%~nX Corel-block" dir=in program="%%X" action=block
)
)
if exist "C:\Program Files (x86)\Corel" (
for /R "C:\Program Files (x86)\Corel" %%X in (*.exe) do (
echo Blocking: %%~nX
netsh advfirewall firewall add rule name="%%~nX Corel-block" dir=out program="%%X" action=block
netsh advfirewall firewall add rule name="%%~nX Corel-block" dir=in program="%%X" action=block
)
)
if exist "C:\Program Files\Common Files\Corel" (
for /R "C:\Program Files\Common Files\Corel" %%X in (*.exe) do (
echo Blocking: %%~nX
netsh advfirewall firewall add rule name="%%~nX Corel-block" dir=out program="%%X" action=block
netsh advfirewall firewall add rule name="%%~nX Corel-block" dir=in program="%%X" action=block
)
)
echo Blocking completed.
pause
endlocal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works great! Thanks for the time and effort.