Skip to content

Instantly share code, notes, and snippets.

@ph33nx
Last active June 16, 2025 06:07
Show Gist options
  • Save ph33nx/0ed14724213c4cc467c85826c9dca908 to your computer and use it in GitHub Desktop.
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
:: ################################################################
:: ## 🔥 WinMasterBlocker 🔥 #
:: ################################################################
:: # Author: https://github.com/ph33nx #
:: # Repo: https://github.com/ph33nx/WinMasterBlocker #
:: # #
:: # This script blocks inbound/outbound network access #
:: # for major apps like Adobe, Autodesk, Corel, Maxon, #
:: # and more using Windows Firewall. #
:: # #
:: # Features: #
:: # - Block executables using windows firewall for popular #
:: # vendors #
:: # - Add or Delete inbound, outbound, or both types of rules #
:: # - Avoids duplicate firewall rules #
:: # - Logs skipped entries for existing rules #
:: # #
:: # Check out the repo to contribute: #
:: # https://github.com/ph33nx/WinMasterBlocker #
:: ################################################################
@echo off
setlocal enabledelayedexpansion
:: Array of vendors and their paths
set "vendors[0]=Adobe"
set "paths[0]=C:\Program Files\Adobe;C:\Program Files\Common Files\Adobe;C:\Program Files (x86)\Adobe;C:\Program Files (x86)\Common Files\Adobe;C:\ProgramData\Adobe"
set "vendors[1]=Corel"
set "paths[1]=C:\Program Files\Corel;C:\Program Files\Common Files\Corel;C:\Program Files (x86)\Corel"
set "vendors[2]=Autodesk"
set "paths[2]=C:\Program Files\Autodesk;C:\Program Files (x86)\Common Files\Macrovision Shared;C:\Program Files (x86)\Common Files\Autodesk Shared"
set "vendors[3]=Maxon"
set "paths[3]=C:\Program Files\Maxon;C:\Program Files (x86)\Maxon;C:\ProgramData\Maxon"
set "vendors[4]=Red Giant"
set "paths[4]=C:\Program Files\Red Giant;C:\Program Files (x86)\Red Giant"
:: Check if script is run as administrator
:check_admin
net session >nul 2>&1
if %errorlevel% neq 0 (
echo.
echo This script must be run as Administrator.
echo Attempting to re-launch with elevated privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
:: If admin, proceed with script
echo Running with Administrator privileges...
goto menu
:: Main menu for user selection
:menu
cls
echo Choose a vendor to block or delete rules:
echo.
:: Iterate through defined vendors
set i=0
:vendor_loop
if not defined vendors[%i%] goto after_vendor_list
echo !i!: !vendors[%i%]!
set /a i+=1
goto vendor_loop
:after_vendor_list
echo 99: Delete all firewall rules (added by this script)
echo.
set /p "choice=Enter your choice (0-99): "
:: Validate if choice is a number between 0 and 99
set /a test_choice=%choice% 2>nul
if "%choice%" neq "%test_choice%" (
echo Invalid input, please enter a valid number.
pause
goto menu
)
:: Dynamic input validation based on the number of vendors
set max_choice=!i!
if "%choice%"=="00" (
goto end
) else if "%choice%"=="99" (
goto delete_menu
) else if %choice% lss %max_choice% (
goto process_vendor
) else (
echo Invalid choice, try again.
pause
goto menu
)
:: Menu for deleting rules (inbound, outbound, both)
:delete_menu
cls
echo Select which firewall rules to DELETE (added by this script):
echo 1: Delete Outbound rules
echo 2: Delete Inbound rules
echo 3: Delete All
echo.
set /p "delete_choice=Enter your choice (1-3): "
if "%delete_choice%"=="1" (
goto delete_outbound
) else if "%delete_choice%"=="2" (
goto delete_inbound
) else if "%delete_choice%"=="3" (
goto delete_both
) else (
echo Invalid choice, try again.
pause
goto delete_menu
)
:: Delete Outbound rules
:delete_outbound
cls
echo Deleting all outbound firewall rules (added by this script)...
for /f "tokens=*" %%r in ('powershell -command "(Get-NetFirewallRule | where {$_.DisplayName -like '*-block'}).DisplayName"') do (
for %%D in (out) do (
netsh advfirewall firewall delete rule name="%%r" dir=%%D
)
)
echo Outbound rules deleted successfully.
goto firewall_check
:: Delete Inbound rules
:delete_inbound
cls
echo Deleting all inbound firewall rules (added by this script)...
for /f "tokens=*" %%r in ('powershell -command "(Get-NetFirewallRule | where {$_.DisplayName -like '*-block'}).DisplayName"') do (
for %%D in (in) do (
netsh advfirewall firewall delete rule name="%%r" dir=%%D
)
)
echo Inbound rules deleted successfully.
goto firewall_check
:: Delete Both Inbound and Outbound rules
:delete_both
cls
echo Deleting all inbound and outbound firewall rules (added by this script)...
for /f "tokens=*" %%r in ('powershell -command "(Get-NetFirewallRule | where {$_.DisplayName -like '*-block'}).DisplayName"') do (
for %%D in (in out) do (
netsh advfirewall firewall delete rule name="%%r" dir=%%D
)
)
echo Inbound and Outbound rules deleted successfully.
goto firewall_check
:: Process each vendor's paths and block executables
:process_vendor
cls
set "selected_vendor=!vendors[%choice%]!"
set "selected_paths=!paths[%choice%]!"
:: Initialize rule counter and a flag to track if any valid path was found
set "rule_count=0"
set "any_valid_path=false"
echo Blocking executables for %selected_vendor% with paths %selected_paths%...
:: Loop through each path and perform a deep nested search for executables
for %%P in ("%selected_paths:;=" "%") do (
set "current_path=%%~P"
echo Checking path: "!current_path!"
if exist "!current_path!" (
set "any_valid_path=true"
echo Path exists: "!current_path!" - Searching for executables...
set "exe_found_in_path=false"
:: Use pushd/popd to make current_path the root of the recursive search
pushd "!current_path!"
for /R %%F in (*.exe) do (
set "current_exe=%%F"
set "exe_found_in_path=true"
echo Found executable: "!current_exe!"
call :check_and_block "!current_exe!" "!selected_vendor!"
)
popd
:: Check if any executables were found in the current path
if "!exe_found_in_path!"=="false" (
echo No executables found in path: "!current_path!"
)
) else (
echo Path not found: "!current_path!"
)
)
:: Final check after loop - notify if no valid directories were found
if "!any_valid_path!"=="false" (
echo No valid directories found for %selected_vendor%.
) else if %rule_count%==0 (
echo No executable files found to block for %selected_vendor%.
)
echo.
echo Completed blocking for %selected_vendor%.
echo Total rules added: %rule_count%
pause
goto menu
:: Function to check if a rule exists, and add it if not
:check_and_block
set "exe_path=%~1"
set "vendor_name=%~2"
set "rule_name=%~n1 %vendor_name%-block"
echo Checking rule for: "%exe_path%"
:: Check if the rule already exists
for /f "tokens=*" %%r in ('powershell -command "(Get-NetFirewallRule | where {$_.DisplayName -eq '%rule_name%'}).DisplayName"') do (
if "%%r"=="%rule_name%" (
echo Rule for "%exe_path%" already exists, skipping...
goto :continue
)
)
:: Add rule if it doesn’t exist
echo Blocking: "%~n1"
netsh advfirewall firewall add rule name="%rule_name%" dir=out program="%exe_path%" action=block
netsh advfirewall firewall add rule name="%rule_name%" dir=in program="%exe_path%" action=block
:: Increment rule count for each rule added
set /a rule_count+=1
:continue
goto :eof
:: Notify user to check Windows Firewall with Advanced Security
:firewall_check
echo.
echo All changes completed. You can verify the new rules in "Windows Firewall with Advanced Security"
echo.
pause
goto menu
:end
endlocal
exit /b
@hannemaster
Copy link

Dear,
only a quick question: I opened the .bat file (not as administrator) and the result is that, for each line, the system told me "Elevation of privileges (Run as administrator) is required for the requested operation.".
But at the end the last sentence was:
"BLOCKING COMPLETED".
So...I don't understand if the .bat file create or not the rules... How can I check it?
In addition, if i want to restore back the rules..how can I do? Please help me.. thanks

Even if it says "Blocking complete" it only means it got to the end of the script. No changes are made if you did not run it as Admin.

Thank You so much!! Could You kindly tell me how can I check if I "added" these blocks or not? Have I to open the notepad and the file C:\Windows\System32\Drivers\etc\hosts, right? For the moment, what I see is this

so, did i do something or not? thanks

The blocks are added to the Windows Defender Firewall. Not the hosts file. It should look like this if it added any blocks, note the "adobe-block".
defender

Copy link

ghost commented Jul 27, 2024

Dear,
only a quick question: I opened the .bat file (not as administrator) and the result is that, for each line, the system told me "Elevation of privileges (Run as administrator) is required for the requested operation.".
But at the end the last sentence was:
"BLOCKING COMPLETED".
So...I don't understand if the .bat file create or not the rules... How can I check it?
In addition, if i want to restore back the rules..how can I do? Please help me.. thanks

Even if it says "Blocking complete" it only means it got to the end of the script. No changes are made if you did not run it as Admin.

Thank You so much!! Could You kindly tell me how can I check if I "added" these blocks or not? Have I to open the notepad and the file C:\Windows\System32\Drivers\etc\hosts, right? For the moment, what I see is this
so, did i do something or not? thanks

The blocks are added to the Windows Defender Firewall. Not the hosts file. It should look like this if it added any blocks, note the "adobe-block".

Ah ok!!thanks...
so..I think I didn't perform it (seen the screen here below, right?)

screen

@hannemaster
Copy link

Ah ok!!thanks... so..I think I didn't perform it (seen the screen here below, right?)

Right. Not only because the rules are not there, but also because you simply cannot modify stuff like this without Elevated permissions(running as administrator).

@overfluxbot
Copy link

seems adobe still can check the unlicensed

@Demonchoker
Copy link

How do i delete the script after. i don't get it. im getting a headache trying to figure it out..

@hannemaster
Copy link

How do i delete the script after. i don't get it. im getting a headache trying to figure it out..

Place it in a folder like C:\AdobeScript
Open a command prompt and run as Administrator
Type "cd c:\adobescript" to navigate to the script
Type "adobe" and press tab to auto-complete the file name.
press space and type "-delete"
Enter. Done.

@lescobarlinero
Copy link

Works flawlessly, great job♡

@AlexGarcias39
Copy link

Hello, is there a video that explains this. It is very confusing for me to understand all this. and i really need help

@bf7041
Copy link

bf7041 commented Sep 27, 2024

OK, this was helpful!

Thanks much for sharing.

@jchademwiri
Copy link

the script worked but now i get a pop-up saying - "We can’t verify your subscription status. We can’t reach the Adobe servers. This may be because you’re not connected to the internet. Check your connection and try again below. If you’re still having issues, please see our connectivity troubleshooting guide. Error code: 12013." any idea to get around this?

I have the same situation, I can't use both photoshop or illustrator

@BALTAGY
Copy link

BALTAGY commented Oct 22, 2024

Deleting rules only delete out rules only not in

Fixed it by replacing netsh advfirewall firewall delete rule name="%%r" with

FOR %%D IN (in out) DO (
netsh advfirewall firewall delete rule name="%%r" dir=%%D
)

Thanks to Tux on discord

@ph33nx
Copy link
Author

ph33nx commented Oct 25, 2024

🚀 Update: Gist -> WinMasterBlocker

Hello everyone!

📢 Important: This Gist has now moved to its own repository! I’ll be managing future updates, issue tracking, and contributions in the new repo. Please consider starring the repo ⭐ to stay updated and track progress.

👉 WinMasterBlocker Repository

I’ve made some exciting updates:

  • Menu: The script now asks what you want to do. It also asks which vendor you want to block.
  • Refactored Logic: Now the script has a more scalable approach and someday in future we may possibly include all the known evil vendors and their installation paths in our little script. contributions welcome ;)
  • New Options: You can now choose to add or delete inbound, outbound, or both types of firewall rules.
  • Expanded Vendor Support: The script now supports blocking even more popular software vendors, helping keep your Windows system in control.

Contributions are very welcome, especially adding more vendors and there installation paths to this firewall batch script.
Thank you for your support!

@erosoft71
Copy link

Sorry Guys, i didn't get any issues to run the Batch files and amend the Host file... But anyone knows what to do at the first run of the Application? Because of course the app cannot be activated and the only option is to close... For sure i miss something... Thanks

@RushBellucci
Copy link

unfortunately even if I run it as admin or from cmd (admin) it just flashes and close itself in an instant :-(
Do I need some microsoft addon? I'm using win 11. BTW thank you for this job that looks like the other people enjoy!

@RushBellucci
Copy link

Ouch, I made a BAT with the code and now since the apps can't chech the license they will close...after tons of years adobe became finally smart... I had to revert and use the the adobe acrobat offline....:-(

@gingggger
Copy link

Screenshot 2025-05-06 203708
Is it because I downloaded photoshop23 version, on a different disk, that it didn't work? What could be causing it to give this out? I've already uninstalled and re-downloaded. I don't know what to do, who can help please. I'm at a loss...

@xek000000kk
Copy link

This script just work, I don't need genp anymore. Thank you!!!

@Drazen-01
Copy link

I cannot open the file. Double click flashes and than nothing. As administrator, does not open.

@xek000000kk
Copy link

I cannot open the file. Double click flashes and than nothing. As administrator, does not open.

Try to download zip and open from there.

@Drazen-01
Copy link

Thank you! The installation worked now with zip.
Still, the Lightroom gives the message unlicensed. What to do?

@Drazen-01
Copy link

... b.t.w. I have checked the firewall... many new blocks are inserted.

@AntonyPH
Copy link

Great script. Worked like a charm, thanks!

@Drazen-01
Copy link

I wonder why do I still get the connection to Adobe?

@xek000000kk
Copy link

Thank you! The installation worked now with zip. Still, the Lightroom gives the message unlicensed. What to do?

This script doesn't fully block Adobe's internet access. If pop-ups appear, you might not have enabled all firewalls in Windows Defender. For Lightroom (which I don't use), the most likely solution is to disable Wi-Fi in Windows.

GenP is an option, but its success is unreliable as Adobe patches it, and GenP can stop working anytime. Another method involves Fiddler (from fmhy), but I find it very complicated and time-consuming.

@ph33nx
Copy link
Author

ph33nx commented May 28, 2025

This script completely blocks internet access for all executables inside common adobe folders (not just adobe domains). Which means you can open adobe sites in your browser, its not domain-block across the system.. Its internet-block for all adobe executables.

For just blocking adobe domains systemwide, you can use the old method of editing your hosts file. Open Notepad as admin then open the hosts file in "C:\Windows\System32\drivers\etc\hosts" then copy paste all the adobe hosts from here from the line 0.0.0.0 adobe.io

Cons of hosts blocking, & why I created this script as a full-proof way

  1. A long hosts file can slow your internet queries
  2. You're only blocking all adobe domains systemwide, any malicious executable can still access internet
  3. You've to keep up with new adobe domains, it can be a full time job

Users having issue with lighroom, can either update line 27 of this script by adding lightroom folders or just contribute here so that I can update the script for everyone. I am not keeping up with Adobe anymore, I am sure they have changed a few things here and there.

@Drazen-01
Copy link

I decided to cut internet since I use Darktable already for one year and need my old Lightroom just to export some old photos which have already been processed.

@Victory61
Copy link

Could this almost daily updated list also be useful?
https://a.dove.isdumb.one/list.txt

@ph33nx
Copy link
Author

ph33nx commented Jun 4, 2025

Could this almost daily updated list also be useful? https://a.dove.isdumb.one/list.txt

domain blocking through hosts file will just slow down your internet (dns queries) locally, especially when the hosts file is this big. based on my tests, instead of blocking some domains systemwide, completely restricting internet through windows inbuilt firewall for all adobe executables is a much leaner and scalable approach & that is exactly what this script does.

benefits include:

  • you dont have to keep up with new adobe domains
  • your dns queries stay fast while browsing
  • adobe executables think your system has no internet, since they cant access it, at all.

@Victory61
Copy link

Thanks for the confirmation, I will opt for firewall blocking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment