Page 2 of 2 FirstFirst 12
  1.    19 Aug 2017 #11
    Join Date : Aug 2017
    Posts : 4
    Windows 10

    [QUOTE=jpeni;947966]Use this batch file to add exe and dll files to Firewall in Windows 10


    Problem is: when you run this batch file as Admin

    it asks whether you want to block Windows/System32 and all its subfolders---NOT EXACTLY WHAT MOST EVERYONE WOULD DESIRE !
      My ComputerSystem Spec
  2.    19 Aug 2017 #12
    Join Date : Aug 2017
    Posts : 4
    Windows 10

    [QUOTE=ARC1020;591205]Windows Firewall doesn't support wildcards, therefore I'm thinking using a batch file would probably be the quickest way. Batch files aren't really my forte, however as an example maybe something along these lines.

    1) Paste ALL the following into NotePad (including the last line that's hidden from view) and obviously edit to show the folder path where the applications that you want to block are.

    Code:
    for %%G in ("C:\Program Files (x86)\Test Folder\*.exe") do (
    
    netsh advfirewall firewall add rule name="Blocked With Batchfile %%G" dir=in action=block program="%%G" enable=yes profile=any
    netsh advfirewall firewall add rule name="Blocked With Batchfile %%G" dir=out action=block program="%%G" enable=yes profile=any
    
    )

    2) Save the text file and rename it to BlockInOut.bat
    .
    .
    .
    .
    .
    etc. etc.

    Tried all of that....didn't do anything...no rules were added.

    EDIT:
    OOOPPSS !! My bad....I didn't try refreshing the rules page ! IT DOES WORK THOUGH!! GREAT THANKS
    Last edited by Cabbagestack; 19 Aug 2017 at 19:40.
      My ComputerSystem Spec
  3.    19 Aug 2017 #13
    Join Date : Aug 2017
    Posts : 4
    Windows 10

    It would help a lot of people if someone could add to that code so that the user specifies a folder and the batch file creates blocking inbound/outbound rules for every .exe and .dll including every subfolder. I just don’t know how… I only speak Java and C++
    ...I don't know anything about the syntax for these batch files
      My ComputerSystem Spec
  4.    19 Aug 2017 #14
    Join Date : Aug 2017
    Posts : 4
    Windows 10

    Actually some one already did that:
    https://sites.google.com/site/mytool...ws-7-firewall/
      My ComputerSystem Spec

 
Page 2 of 2 FirstFirst 12


Similar Threads
Thread Forum
Batch File - Find Multiple Files From Multiple Locations
Hi, I'm not new to Batch Files but i have a requirement that i can't seem to get my head around, I'm sure it must be simple'ish.. I have 2 .txt files (Locations.txt | Files.txt) Locations is a list of directories Files is a list of...
General Support
right click on multiple files sometime appear windows defender why?
hi i have noticed that when i select multiple files or folder sometime appears analyzes with windows defender my antivirus is eset smart security 9 ,that include antivirus , firewall and hips windows defender is disabled the strange thing...
General Support
How to block downloading upgrade to Windows 10?
Hi, I do not know if this is the appropriate forum but really I need help. I have Windows 8.1 and I can not install the updates to Windows 8.1 in Windows Update because it always starts downloading Windows 10. How to block downloading Windows 10 and...
Windows Updates and Activation
Block Windows Update downloading on WIn 10 Home?
I can't have my notebook (upgraded from Win 7 Home) using bandwidth to download from Windows Update when I'm away from home. It seems I must either (a) mark every wifi connection as metered, or (b) mark the startup setting for the WAU service as...
Windows Updates and Activation
User Accounts Allow or Block Family Member using a PC in Windows 10
It’s easy to share your Windows 10 PC with family members. Add family members using Add a family member from your PC's Settings, and they’ll be able to use that PC as well. And you're always in control. You can allow or block them from using a PC at...
Tutorials
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:23.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums