Jump to content

michaelleewebb

Member
  • Posts

    2
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About michaelleewebb

Profile Information

  • OS
    none specified

michaelleewebb's Achievements

0

Reputation

  1. first and foremost i am no vbscript expert. but maybe i can help. i don't think you can use msgbox. i think you need to create a custom dialog box which looks and acts just like a msgbox but is in fact your own creation that does allow gif's in it. from what i've read you'll need to create an htm file and have ie display it. i have a link to a site thats doing something like what you what, its an old blog so it may or may not work. i can't test it here i don't have ie on my computer. read the article and maybe try it out then reply back on what you find. keep in mind that i don't think this is the total solution to your problem, but i think its a start in the right direction. link is: http://blogs.technet.com/b/heyscriptingguy/archive/2007/07/19/how-can-i-create-a-custom-dialog-box.aspx
  2. i'm trying to block utorrent via the firewall using vba. utorrent is installed and it created an opening in the firewall. where i want to get to is a vbs script that block utorrent and other script that unblocks it. so far i cant even block it. heres the code i'm trying to use. could someone help me ?? Option Explicit Dim CurrentProfiles Dim InterfaceArray Dim LowerBound Dim UpperBound Dim iterate Dim rule ' Profile Type Const NET_FW_PROFILE2_DOMAIN = 1 Const NET_FW_PROFILE2_PRIVATE = 2 Const NET_FW_PROFILE2_PUBLIC = 4 ' Protocol Const NET_FW_IP_PROTOCOL_TCP = 6 Const NET_FW_IP_PROTOCOL_UDP = 17 Const NET_FW_IP_PROTOCOL_ICMPv4 = 1 Const NET_FW_IP_PROTOCOL_ICMPv6 = 58 ' Direction Const NET_FW_RULE_DIR_IN = 1 Const NET_FW_RULE_DIR_OUT = 2 ' Action Const NET_FW_ACTION_BLOCK = 0 Const NET_FW_ACTION_ALLOW = 1 ' Create the FwPolicy2 object. Dim fwPolicy2 Set fwPolicy2 = CreateObject("HNetCfg.FwPolicy2") CurrentProfiles = fwPolicy2.CurrentProfileTypes '// The returned 'CurrentProfiles' bitmask can have more than 1 bit set if multiple profiles '// are active or current at the same time if ( CurrentProfiles AND NET_FW_PROFILE2_DOMAIN ) then WScript.Echo("Domain Firewall Profile is active") end if if ( CurrentProfiles AND NET_FW_PROFILE2_PRIVATE ) then WScript.Echo("Private Firewall Profile is active") end if if ( CurrentProfiles AND NET_FW_PROFILE2_PUBLIC ) then WScript.Echo("Public Firewall Profile is active") end if ' Get the Rules object Dim RulesObject Set RulesObject = fwPolicy2.Rules ' Print all the rules in currently active firewall profiles. WScript.Echo("Rules:") For Each rule In Rulesobject if rule.Profiles And CurrentProfiles then if rule.ApplicationName = "C:\Program Files\uTorrent\uTorrent.exe" then rule.Enabled = false WScript.Echo(" Rule Name: " & rule.Name) WScript.Echo(" ----------------------------------------------") WScript.Echo(" Description: " & rule.Description) WScript.Echo(" Application Name: " & rule.ApplicationName) WScript.Echo(" Service Name: " & rule.ServiceName) Select Case rule.Protocol Case NET_FW_IP_PROTOCOL_TCP WScript.Echo(" IP Protocol: TCP.") Case NET_FW_IP_PROTOCOL_UDP WScript.Echo(" IP Protocol: UDP.") Case NET_FW_IP_PROTOCOL_ICMPv4 WScript.Echo(" IP Protocol: UDP.") Case NET_FW_IP_PROTOCOL_ICMPv6 WScript.Echo(" IP Protocol: UDP.") Case Else WScript.Echo(" IP Protocol: " & rule.Protocol) End Select if rule.Protocol = NET_FW_IP_PROTOCOL_TCP or rule.Protocol = NET_FW_IP_PROTOCOL_UDP then WScript.Echo(" Local Ports: " & rule.LocalPorts) WScript.Echo(" Remote Ports: " & rule.RemotePorts) WScript.Echo(" LocalAddresses: " & rule.LocalAddresses) WScript.Echo(" RemoteAddresses: " & rule.RemoteAddresses) end if if rule.Protocol = NET_FW_IP_PROTOCOL_ICMPv4 or rule.Protocol = NET_FW_IP_PROTOCOL_ICMPv6 then WScript.Echo(" ICMP Type and Code: " & rule.IcmpTypesAndCodes) end if Select Case rule.Direction Case NET_FW_RULE_DIR_IN WScript.Echo(" Direction: In") Case NET_FW_RULE_DIR_OUT WScript.Echo(" Direction: Out") End Select WScript.Echo(" Enabled: " & rule.Enabled) WScript.Echo(" Edge: " & rule.EdgeTraversal) Select Case rule.Action Case NET_FW_ACTION_ALLOW WScript.Echo(" Action: Allow") Case NET_FW_ACTION_BLOCk WScript.Echo(" Action: Block") End Select WScript.Echo(" Grouping: " & rule.Grouping) WScript.Echo(" Edge: " & rule.EdgeTraversal) WScript.Echo(" Interface Types: " & rule.InterfaceTypes) InterfaceArray = rule.Interfaces if IsEmpty(InterfaceArray) then WScript.Echo(" Interfaces: All") else LowerBound = LBound(InterfaceArray) UpperBound = UBound(InterfaceArray) WScript.Echo(" Interfaces: ") for iterate = LowerBound To UpperBound WScript.Echo(" " & InterfaceArray(iterate)) Next end if WScript.Echo("") end if end if Next
×
×
  • Create New...