Results 1 to 2 of 2

Thread: how to add the port at windows 7 firewall??HELP

  1. #1
    Join Date
    Sep 2010
    Posts
    1

    sad how to add the port at windows 7 firewall??HELP

    i need add port at inbound rule and outbound rule in windows7 firewall by the code below!but after i add at windows 7 firewall,the firewall still block the application.
    When i check the details of port at inbound rules,the protocol and local port are ANY.It suppose is TCP and 8098!
    When i check the details of port at outbound rules,the protocol and local port are ANY.It suppose is TCP and 8098!
    my application is riskkOnePortFolio and the type of application is Application Manifest(.application)

    Anyone can tell me how to correct the code below ?Thanks....I very need yours help,please....

    Inbound Rules
    option explicit

    Dim CurrentProfiles

    ' Protocol
    Const NET_FW_IP_PROTOCOL_TCP = 6
    Const NET_FW_IP_PROTOCOL_UDP = 17

    'Direction
    Const NET_FW_RULE_DIR_IN = 1
    Const NET_FW_RULE_DIR_OUT = 2

    'Action
    Const NET_FW_ACTION_ALLOW = 1

    ' Create the FwPolicy2 object.
    Dim fwPolicy2
    Set fwPolicy2 = CreateObject("HNetCfg.FwPolicy2")

    ' Get the Rules object
    Dim RulesObject
    Set RulesObject = fwPolicy2.Rules

    CurrentProfiles = fwPolicy2.CurrentProfileTypes

    'Create a Rule Object.
    Dim NewRule
    Set NewRule = CreateObject("HNetCfg.FWRule")

    NewRule.Name = "Inbound_Rule"
    NewRule.Description = "Allow outbound network traffic from my Application over TCP port 8098"
    NewRule.Applicationname = "C:\User\lim\Client\RiskkOnePortFolio.application"
    NewRule.Protocol = TCP
    NewRule.RemotePort = 8098
    NewRule.Direction = NET_FW_RULE_DIR_IN
    NewRule.Enabled = TRUE
    NewRule.Grouping = "@firewallapi.dll,-23255"
    NewRule.Profiles = CurrentProfiles
    NewRule.Action = NET_FW_ACTION_ALLOW

    'Add a new rule
    RulesObject.Add NewRule

    Outbound Rules
    option explicit

    Dim CurrentProfiles

    ' Protocol
    Const NET_FW_IP_PROTOCOL_TCP = 6
    Const NET_FW_IP_PROTOCOL_UDP = 17

    'Direction
    Const NET_FW_RULE_DIR_IN = 1
    Const NET_FW_RULE_DIR_OUT = 2

    'Action
    Const NET_FW_ACTION_ALLOW = 1

    ' Create the FwPolicy2 object.
    Dim fwPolicy2
    Set fwPolicy2 = CreateObject("HNetCfg.FwPolicy2")

    ' Get the Rules object
    Dim RulesObject
    Set RulesObject = fwPolicy2.Rules

    CurrentProfiles = fwPolicy2.CurrentProfileTypes

    'Create a Rule Object.
    Dim NewRule
    Set NewRule = CreateObject("HNetCfg.FWRule")

    NewRule.Name = "Outbound_Rule"
    NewRule.Description = "Allow outbound network traffic from my Application over TCP port 8098"
    NewRule.Applicationname = "C:\User\lim\Client\RiskkOnePortFolio.application"
    NewRule.Protocol = TCP
    NewRule.RemotePort = 8098
    NewRule.Direction = NET_FW_RULE_DIR_OUT
    NewRule.Enabled = TRUE
    NewRule.Grouping = "@firewallapi.dll,-23255"
    NewRule.Profiles = CurrentProfiles
    NewRule.Action = NET_FW_ACTION_ALLOW

    'Add a new rule
    RulesObject.Add NewRule

  2. #2
    Join Date
    Feb 2011
    Posts
    116

    Re: how to add the port at windows 7 firewall??HELP

    Well what I want you to do her is that just open then "Windows Firewall with Advanced Security". Now in that you will find the search box in that you have to type firewall and then see the results in the start menu and then you can add or remove ports from the same.

Similar Threads

  1. Windows Firewall Port Ranges?
    By Rschraeger in forum Windows Server Help
    Replies: 5
    Last Post: 28-10-2012, 09:42 AM
  2. Is it possible to get windows firewall open port?
    By Pratim in forum Windows Security
    Replies: 10
    Last Post: 24-01-2012, 09:43 AM
  3. How to allow TCP port 3389 on Windows Firewall
    By DotNetUser in forum Networking & Security
    Replies: 2
    Last Post: 31-07-2009, 06:05 PM
  4. Open Port and set IP protocol for Windows Firewall
    By Jamaima in forum Networking & Security
    Replies: 2
    Last Post: 20-02-2009, 09:52 PM
  5. Windows XP Firewall XP close port
    By WarRen! in forum Windows Security
    Replies: 2
    Last Post: 09-02-2009, 08:04 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,717,619.87893 seconds with 17 queries