Disable internet access for specific app via CMD


infinity

Well-known member
VIP
Local time
1:32 PM
Posts
110
OS
Win 11
I know how to disable the entire network adapter, but is there also a command in cmd that I can use to easily switch on/off internet access to specific processes, E.g. Zoom.exe? Understand I can do it via Firewall settings but I prefer a CMD method.

Thank you.
 

My Computer

System One

  • OS
    Win 11
    Computer type
    PC/Desktop
    CPU
    Ryzen 3600
    Motherboard
    MSI B450 Tomahawk Max
    Memory
    GSkill RipJawz 16Gbx2
    Graphics Card(s)
    GTX960
    Screen Resolution
    2560x1440
    Hard Drives
    WD750 SSD 1TB
    PSU
    650w FSP
Hi al
here is dos commands i use to stop internet:
netsh interface set interface "Ethernet" admin=disable
netsh interface set interface "Wi-Fi" admin=disable

Then to restart:
netsh interface set interface "Ethernet" admin=enable
netsh interface set interface "Wi-Fi" admin=enable
Hope this help you!
 

My Computers

System One System Two

  • OS
    Window 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Mine
    CPU
    intel I7 860
    Motherboard
    Asus P7P55D
    Memory
    DDR3 8 Go
    Graphics Card(s)
    on mother board
    Sound Card
    on mother board
    Monitor(s) Displays
    LG 24 "
    Screen Resolution
    1920x1080
    Hard Drives
    SSD 512 Go , Toshiba 1 To, Toshiba 3 To
    Case
    Mine
    Cooling
    via box
    Keyboard
    Logitech
    Mouse
    Logitech
    Internet Speed
    Fiber 1 Go
    Browser
    Firefox, Opera
    Antivirus
    Windows defender, MalwareByte on demand
  • Operating System
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Mine
    CPU
    Intel I5 4570
    Motherboard
    Asus H87M
    Memory
    DDR3 8 Go
    Graphics card(s)
    on board
    Sound Card
    on board
    Monitor(s) Displays
    Asus 24 "
    Screen Resolution
    1920x1080
    Hard Drives
    SSD 512 Go ( system), Toshiba 3 To
    Case
    Mine
    Cooling
    Normal
    Mouse
    Logitech
    Keyboard
    Digital
    Internet Speed
    Fiber 1 Go
    Browser
    Firefox, Opera
    Antivirus
    Windows Defender,MalwareByte on demand
And another for specific app, you can use Windows Firewall through output rule (example for skype):

netsh advfirewall firewall add rule name="Block skype" dir=in action=deny program="C:\program\skype.exe" enable=yes
 

My Computers

System One System Two

  • OS
    Window 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Mine
    CPU
    intel I7 860
    Motherboard
    Asus P7P55D
    Memory
    DDR3 8 Go
    Graphics Card(s)
    on mother board
    Sound Card
    on mother board
    Monitor(s) Displays
    LG 24 "
    Screen Resolution
    1920x1080
    Hard Drives
    SSD 512 Go , Toshiba 1 To, Toshiba 3 To
    Case
    Mine
    Cooling
    via box
    Keyboard
    Logitech
    Mouse
    Logitech
    Internet Speed
    Fiber 1 Go
    Browser
    Firefox, Opera
    Antivirus
    Windows defender, MalwareByte on demand
  • Operating System
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Mine
    CPU
    Intel I5 4570
    Motherboard
    Asus H87M
    Memory
    DDR3 8 Go
    Graphics card(s)
    on board
    Sound Card
    on board
    Monitor(s) Displays
    Asus 24 "
    Screen Resolution
    1920x1080
    Hard Drives
    SSD 512 Go ( system), Toshiba 3 To
    Case
    Mine
    Cooling
    Normal
    Mouse
    Logitech
    Keyboard
    Digital
    Internet Speed
    Fiber 1 Go
    Browser
    Firefox, Opera
    Antivirus
    Windows Defender,MalwareByte on demand
And another for specific app, you can use Windows Firewall through output rule (example for skype):

netsh advfirewall firewall add rule name="Block skype" dir=in action=deny program="C:\program\skype.exe" enable=yes
Yes I just need this. Is there a parameter I can use to just indicate the process name instead of the process path? Thank you.

Similarly, if I want to remove the rull, do I change "add" to "remove"?

Lastly, can I enter the command WITHOUT a rule name?
 

My Computer

System One

  • OS
    Win 11
    Computer type
    PC/Desktop
    CPU
    Ryzen 3600
    Motherboard
    MSI B450 Tomahawk Max
    Memory
    GSkill RipJawz 16Gbx2
    Graphics Card(s)
    GTX960
    Screen Resolution
    2560x1440
    Hard Drives
    WD750 SSD 1TB
    PSU
    650w FSP
Hi!

1. for stoping running process, i suggest command dos TakKill ( in command prompt, type "TaskKill /?" to know all the attached parameters
2. Yes, "delete" instead of "add" kill the rule.
3. rule name is necessary in nstsh command, but you can use blank.
 

My Computers

System One System Two

  • OS
    Window 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Mine
    CPU
    intel I7 860
    Motherboard
    Asus P7P55D
    Memory
    DDR3 8 Go
    Graphics Card(s)
    on mother board
    Sound Card
    on mother board
    Monitor(s) Displays
    LG 24 "
    Screen Resolution
    1920x1080
    Hard Drives
    SSD 512 Go , Toshiba 1 To, Toshiba 3 To
    Case
    Mine
    Cooling
    via box
    Keyboard
    Logitech
    Mouse
    Logitech
    Internet Speed
    Fiber 1 Go
    Browser
    Firefox, Opera
    Antivirus
    Windows defender, MalwareByte on demand
  • Operating System
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Mine
    CPU
    Intel I5 4570
    Motherboard
    Asus H87M
    Memory
    DDR3 8 Go
    Graphics card(s)
    on board
    Sound Card
    on board
    Monitor(s) Displays
    Asus 24 "
    Screen Resolution
    1920x1080
    Hard Drives
    SSD 512 Go ( system), Toshiba 3 To
    Case
    Mine
    Cooling
    Normal
    Mouse
    Logitech
    Keyboard
    Digital
    Internet Speed
    Fiber 1 Go
    Browser
    Firefox, Opera
    Antivirus
    Windows Defender,MalwareByte on demand
Hi!

1. for stoping running process, i suggest command dos TakKill ( in command prompt, type "TaskKill /?" to know all the attached parameters
2. Yes, "delete" instead of "add" kill the rule.
3. rule name is necessary in nstsh command, but you can use blank.

Hihi, I tried blocking Firefox with this command but I can still do a google search on it. Why so?

1648078985941.png
 

My Computer

System One

  • OS
    Win 11
    Computer type
    PC/Desktop
    CPU
    Ryzen 3600
    Motherboard
    MSI B450 Tomahawk Max
    Memory
    GSkill RipJawz 16Gbx2
    Graphics Card(s)
    GTX960
    Screen Resolution
    2560x1440
    Hard Drives
    WD750 SSD 1TB
    PSU
    650w FSP
Problem is from blanks in "c:\Program Files\Mozilla Firefox\Firefox.exe"
Use aditional quotes as : ' "c:\Program Files\Mozilla Firefox\Firefox.exe" '
 

My Computers

System One System Two

  • OS
    Window 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Mine
    CPU
    intel I7 860
    Motherboard
    Asus P7P55D
    Memory
    DDR3 8 Go
    Graphics Card(s)
    on mother board
    Sound Card
    on mother board
    Monitor(s) Displays
    LG 24 "
    Screen Resolution
    1920x1080
    Hard Drives
    SSD 512 Go , Toshiba 1 To, Toshiba 3 To
    Case
    Mine
    Cooling
    via box
    Keyboard
    Logitech
    Mouse
    Logitech
    Internet Speed
    Fiber 1 Go
    Browser
    Firefox, Opera
    Antivirus
    Windows defender, MalwareByte on demand
  • Operating System
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Mine
    CPU
    Intel I5 4570
    Motherboard
    Asus H87M
    Memory
    DDR3 8 Go
    Graphics card(s)
    on board
    Sound Card
    on board
    Monitor(s) Displays
    Asus 24 "
    Screen Resolution
    1920x1080
    Hard Drives
    SSD 512 Go ( system), Toshiba 3 To
    Case
    Mine
    Cooling
    Normal
    Mouse
    Logitech
    Keyboard
    Digital
    Internet Speed
    Fiber 1 Go
    Browser
    Firefox, Opera
    Antivirus
    Windows Defender,MalwareByte on demand
still running into the same issues:
1648289536320.png
 

My Computer

System One

  • OS
    Win 11
    Computer type
    PC/Desktop
    CPU
    Ryzen 3600
    Motherboard
    MSI B450 Tomahawk Max
    Memory
    GSkill RipJawz 16Gbx2
    Graphics Card(s)
    GTX960
    Screen Resolution
    2560x1440
    Hard Drives
    WD750 SSD 1TB
    PSU
    650w FSP
Hihi, I tried blocking Firefox with this command but I can still do a google search on it. Why so?
You want to block out not in. Hardly any app uses in, though Firefox uses it for TCP loopback. :unsure:
Code:
netsh advfirewall firewall add rule name="FF Block In" protocol=TCP dir=in action=block program="%ProgramFiles%\Mozilla Firefox\Firefox.exe"
netsh advfirewall firewall add rule name="FF Block TCP" protocol=TCP dir=out action=block program="%ProgramFiles%\Mozilla Firefox\Firefox.exe"
netsh advfirewall firewall add rule name="FF Block UDP" protocol=UDP dir=out action=block program="%ProgramFiles%\Mozilla Firefox\Firefox.exe"
Why do not you use something like Firewall App Blocker (Fab) v1.7 ? It allows a simple CMD input.
Code:
Fab.exe /a %ProgramFiles%\Mozilla Firefox\Firefox.exe
 

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 5 8600G (07/24)
    Motherboard
    ASROCK B650M-HDV/M.2 3.20 (07/24)
    Memory
    2x32GB Kingston FURY DDR5 5600 MHz CL36 @5200 CL40 (07/24)
    Graphics Card(s)
    ASROCK Radeon RX 6600 Challenger D 8G @60FPS (08/24)
    Sound Card
    Creative Sound BlasterX AE-5 Plus (05/24)
    Monitor(s) Displays
    24" Philips 24M1N3200ZS/00 (05/24)
    Screen Resolution
    1920×1080@165Hz via DP1.4
    Hard Drives
    Kingston KC3000 NVMe 2TB (05/24)
    ADATA XPG GAMMIX S11 Pro 512GB (07/19)
    PSU
    Seasonic Core GM 550 Gold (04/24)
    Case
    Fractal Design Define 7 Mini with 3x Noctua NF-P14s/12@555rpm (04/24)
    Cooling
    Noctua NH-U12S with Noctua NF-P12 (04/24)
    Keyboard
    HP Pavilion Wired Keyboard 300 (07/24) + Rabalux 76017 Parker (01/24)
    Mouse
    Logitech M330 Silent Plus (04/23)
    Internet Speed
    500/100 Mbps via RouterOS (05/21) & TCP Optimizer
    Browser
    Edge & Brave for YouTube & LibreWolf for FB
    Antivirus
    NextDNS blocking 99% TLDs
    Other Info
    Backup: Hasleo Backup Suite (PreOS)
    Headphones: Sennheiser RS170 (09/10)
    Phone: Samsung Galaxy Xcover 7 (02/24)
    Chair: Huzaro Force 4.4 Grey Mesh (05/24)
    Notifier: Xiaomi Mi Band 9 Milanese (10/24)
    2nd Monitor: AOC G2460VQ6 @75Hz (02/19)

Latest Support Threads

Back
Top Bottom