Disable internet access for specific app via CMD


infinity

Active member
VIP
Local time
12:30 AM
Posts
109
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 3600 & No fTPM (07/19)
    Motherboard
    MSI B450 TOMAHAWK 7C02v1E & IFX TPM (07/19)
    Memory
    4x 8GB ADATA XPG GAMMIX D10 DDR4 3200MHz CL16
    Graphics Card(s)
    MSI Radeon RX 580 ARMOR 8G OC @48FPS (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 (07/19)
    Keyboard
    HP Wired Desktop 320K + Rabalux 76017 Parker (01/24)
    Mouse
    Logitech M330 Silent Plus (04/23)
    Internet Speed
    400/40 Mbps via RouterOS (05/21) & TCP Optimizer
    Browser
    Edge (No FB/Google) & Brave for YouTube & LibreWolf for FB
    Antivirus
    NoAV & Binisoft WFC & NextDNS
    Other Info
    Headphones: Sennheiser RS170 (09/10)
    Phone: Samsung Galaxy Xcover 7 (02/24)

Latest Support Threads

Back
Top Bottom