tags:

views:

847

answers:

1

I am testing an application which communicates to a server via a UDP port, and I need to block this port to make sure the application can handle it.
The Problems:
1. It has to be done in an automated test (which is controlled by VBScripts).
2. It has to be done in Windows XP, without using a firewall.

I have tried this:


Set objFirewall = CreateObject("HNetCfg.FwMgr")
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
Set colPorts = objPolicy.GloballyOpenPorts

Set objPort = colPorts.Item(9999,6)
objPort.Enabled = FALSE

but it did not work.

+1  A: 

This may be of interest: How to block specific network protocols and ports by using IPSec http://support.microsoft.com/kb/813878

Remou