Có lúc cần chặn ứng dụng truy cập Internet: nghi ngờ malware, hoặc không muốn con lướt web trên máy làm việc. Hướng dẫn chặn truy cập Internet của chương trình ngay từ menu chuột phải (context menu).
Lưu ý: Thao tác sửa registry. Backup registry trước. Chỉ hoạt động Windows 7/Vista, không chạy trên XP.
Registry Hack
Sửa registry để menu chuột phải file .exe xuất hiện:
Tải file registry Firewall.reg. Nội dung:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\exefile\shell] [HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall] [HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall\command] @="netsh advfirewall firewall add rule name=\"%1\" dir=out action=block program=\"%1\"" [HKEY_CLASSES_ROOT\exefile\shell\Delete From Firewall] [HKEY_CLASSES_ROOT\exefile\shell\Delete From Firewall\command] @="netsh advfirewall firewall delete rule name=\"%1\""
Double-click file → Yes UAC → Yes xác nhận.
Tìm uac trong Start → kéo thanh trượt về Never notify → OK → Restart máy.
Lưu ý: Chỉ đặt UAC "Never notify" khi add/xóa rule firewall. Sau khi xong, khôi phục UAC mặc định.
Ví dụ: Chặn Internet Explorer
- Tìm "Internet Explorer" trong Start.
- Chuột phải → Add To Firewall.
- Kiểm tra Firewall settings → Outbound Rules: IE đã được thêm.
- Chọn Delete From Firewall để gỡ rule.
Gỡ bỏ tính năng
Tải file UninstallFirewall.reg:
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall] [-HKEY_CLASSES_ROOT\exefile\shell\Delete From Firewall]
- Gỡ block tất cả app đã chặn trước.
- Double-click file uninstall → OK. Tùy chọn Firewall biến mất khỏi context menu.
Luôn nhớ khôi phục UAC về mặc định.