+ Post New Thread
Results 1 to 10 of 10
Scripts Thread, VBS to remove Windows Firewall exception in Coding and Web Development; I would like to remove a exception from Windows Firewall the name of the entry is: wIntegrate Session Manager The ...
  1. #1

    Join Date
    May 2009
    Posts
    20
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    VBS to remove Windows Firewall exception

    I would like to remove a exception from Windows Firewall the name of the entry is:
    wIntegrate Session Manager

    The path can be different on oher machines so we can use that in the script can someone make a script that removes the wIntegrate Session Manager?

    Thanks,
    Simon

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,720
    Thank Post
    3,248
    Thanked 1,049 Times in 971 Posts
    Rep Power
    364
    Remove application exception (VBScript) - Windows Server 2003 Networking Recipes

    Code:
    ' From the book "Windows Server 2003 Networking Recipes"
    
    ' This code removes an existing application exception
    '  and re-creates it with new values
    ' ------ SCRIPT CONFIGURATION ------
     Set Firewall = CreateObject("HNetCfg.FwMgr")
     Set Policy = Firewall.LocalPolicy
     Set Profile = Policy.GetProfileByType(1)
     strCurrentApp = "c:\program files\image\image123.exe"
     strNewApp = "c:\program files\image\imaging.exe"
    ' ------ END CONFIGURATION ---------
    
    Set colApplications = Profile.AuthorizedApplications
    
    For Each Application in colApplications
      If Application.ProcessImageFileName = strCurrentApp Then
        WScript.Echo "Removed " & Application.Name " from authorized list!"
        colApplications.Remove(Application)
      End If
    Next
    
    Set newApplication = CreateObject("HNetCfg.FwAuthorizedApplication")
    newApplication.Name = "Imaging"
    newApplication.IPVersion = 2
    newApplication.ProcessImageFileName = strNewApp
    newApplication.RemoteAddresses = "*"
    newApplication.Scope = 0
    newApplication.Enabled = True
    
    colApplications.Add(objApplication)
    
    WScript.Echo "Application " & strNewApp & " added successfully!"
    As you can see in the code snippet above it removes current exceptions from the firewall and re adds new ones so you can obviously alter the code to your liking.

  3. #3

    Join Date
    May 2009
    Posts
    20
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks im having problems edditing it can get it to work sorry.

    All i want is it to find the Windows Firewall entry named:

    wIntegrate Session Manager
    path = never the same

    And I just want it to delete it I dont need to replace it.

    Thanks,
    Simon

  4. #4

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,084
    Thank Post
    853
    Thanked 2,679 Times in 2,272 Posts
    Blog Entries
    9
    Rep Power
    769
    Untested but this should work:
    Code:
    ' ------ SCRIPT CONFIGURATION ------
     Set Firewall = CreateObject("HNetCfg.FwMgr")
     Set Policy = Firewall.LocalPolicy
     Set Profile = Policy.GetProfileByType(1)
     strCurrentApp = "wIntegrate Session Manager"
    ' ------ END CONFIGURATION ---------
    Set colApplications = Profile.AuthorizedApplications
    For Each Application in colApplications
      If Application.Name = strCurrentApp Then
        WScript.Echo "Removed " & Application.Name & " from authorized list!"
        colApplications.Remove(Application)
      End If
    Next
    Last edited by SYNACK; 2nd June 2009 at 08:01 AM. Reason: Fixed error

  5. #5

    Join Date
    May 2009
    Posts
    20
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    It keeps comming up with:

    Line:10
    Char: 48
    Error: Expected end of statement
    Code: 800A0401
    Source: Microsoft VBScript compilation error

  6. #6

    Join Date
    May 2009
    Posts
    20
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    It pops up saying Removed wIntegrate Session Manager from authorized list! then pops up saying:

    Line:11
    Char:5
    Error: Type mismatch: 'colApplications.Remove'
    Code: 800A000D
    Source: Microsoft VBScript runtime error

    And the wIntegrate Session Manager is still listed in the firewall Exceptions.

  7. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,720
    Thank Post
    3,248
    Thanked 1,049 Times in 971 Posts
    Rep Power
    364
    longer example here on ms site

    RemovePrograms-com.vbs

    Is there anyway you can look in the registry on a couple of computers to see if there is a definte registry key where it has the path to the wintegrate session manager application exe or at least to the correct directory.

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curr entVersion\Uninstall

    Hopefully in that registry key you should be able to find the session manager and hopefully it should give you a path which you can use in the vbscript to remove it.

  8. Thanks to mac_shinobi from:

    simons2009 (3rd June 2009)

  9. #8

    Join Date
    May 2009
    Posts
    20
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Yes we could find the path as i could run this script before the one below or maybe merge it together:

    Code:
    set oFSO=createobject("scripting.filesystemobject")
    set oShell=createobject("wscript.shell")
    Dim objFSO, objFiles, objShell, intCount
    Dim strFile, strName, strLongName, strDirectory, strEnv, strExt
    Set objShell = CreateObject("Wscript.Shell")
    strEnv = objShell.ExpandEnvironmentStrings("%temp%")
    intcount = 0
    
    
    on error resume next
    sFile=oShell.regread("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\IbsFont")
    on error goto 0
    if sFile="" then 
    else
    set oFile=ofso.getfile(sFile)
    sfolder=oFile.parentfolder & "\session"
    ofso.copyfolder sFolder , strEnv & "\tempkcs" , true
    end if
    The path is the wIntegSM.exe located in the oFile.parentfolder (e.g. C:\Program Files\wIntegrate\wIntegSM.exe)

  10. #9

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,720
    Thank Post
    3,248
    Thanked 1,049 Times in 971 Posts
    Rep Power
    364
    In the MS example it requires the name of the exception or application exe / process name and also the full path to the exe including the exe ie

    notepad

    x:\windows\system32\notepad.exe

  11. Thanks to mac_shinobi from:

    simons2009 (3rd June 2009)

  12. #10

    Join Date
    May 2009
    Posts
    20
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Your properly right, but donít worry about it I found even the official installer from IBM did not clean this up so it doesnít matter and as lest now the new installer I made that adds the firewall entry with Advanced Installer now removes the new entry on uninstall so lets not worry about cleaning someoneís old mess its not worth worrying about.

SHARE:
+ Post New Thread

Similar Threads

  1. VBS to remove Profiles on logon (Works!)
    By andrew_obrien in forum Scripts
    Replies: 12
    Last Post: 15th April 2009, 04:19 PM
  2. Windows Firewall - uninstall?
    By Ryan in forum Windows
    Replies: 18
    Last Post: 14th February 2008, 04:56 PM
  3. Did MS do something windows firewall?
    By Teth in forum Windows
    Replies: 5
    Last Post: 20th September 2007, 09:15 AM
  4. Windows Firewall
    By Mintsoft in forum Windows
    Replies: 3
    Last Post: 22nd March 2006, 09:59 AM
  5. Windows Firewall
    By GrumbleDook in forum Windows
    Replies: 16
    Last Post: 31st August 2005, 12:54 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •