Disable internet access for specific app via CMD


infinity

Active member
Local time
6:34 PM
Posts
108
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

Mau370

Member
Local time
12:34 PM
Posts
5
Location
Paris
OS
Window 11
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

Mau370

Member
Local time
12:34 PM
Posts
5
Location
Paris
OS
Window 11
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

infinity

Active member
Thread Starter
Local time
6:34 PM
Posts
108
OS
Win 11
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

Mau370

Member
Local time
12:34 PM
Posts
5
Location
Paris
OS
Window 11
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

infinity

Active member
Thread Starter
Local time
6:34 PM
Posts
108
OS
Win 11
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

Mau370

Member
Local time
12:34 PM
Posts
5
Location
Paris
OS
Window 11
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

infinity

Active member
Thread Starter
Local time
6:34 PM
Posts
108
OS
Win 11
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

TairikuOkami

Brony
Power User
VIP
Local time
12:34 PM
Posts
471
OS
Windows 11 Home
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
    CPU
    AMD Ryzen 5 3600 (07/19)
    Motherboard
    MSI B450 TOMAHAWK 7C02v1E (07/19)
    Memory
    4x 8GB ADATA XPG GAMMIX D10 DDR4 3200MHz CL16
    Graphics Card(s)
    MSI Radeon RX 580 ARMOR 8G OC (08/19)
    Sound Card
    Creative Sound Blaster Z (11/16)
    Monitor(s) Displays
    24" AOC G2460VQ6 (01/19)
    Screen Resolution
    1920×1080@75Hz + FreeSync (DisplayPort)
    Hard Drives
    ADATA XPG GAMMIX S11 Pro SSD 512GB (07/19)
    PSU
    Seasonic M12II-520 80 Plus Bronze (11/16)
    Case
    Lian Li PC-7NB + 3x Noctua NF-S12A FLX@700rpm (11/16)
    Cooling
    CPU Cooler Noctua NH-U12S@700rpm
    Keyboard
    HP Wired Desktop 320K Keyboard (04/22)
    Mouse
    HP Wireless Silent 280M Mouse (05/21)
    Internet Speed
    400/40 Mbps via RouterOS (05/21) + TCP Optimizer
    Browser
    Microsoft Edge
    Antivirus
    None
    Other Info
    Headphones: Sennheiser RS170 (09/10)
Top Bottom