.vbs to disable firewall based on OS

I need to determine OS and disable firewall accordingly.  Windows xp works, however HNetCFg.FwMgr  does not work on Vista or 7 - oh and GPO is not an option - any help much appreciated.  (ignore msgbox as i was simply testing)
Set objWshShell = WScript.CreateObject("WScript.Shell")
strOSVersion = objWshShell.RegRead("HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
If strOSVersion = "5.1" Then
    Debug.WriteLine("Windows XP")
    Set objFirewall = CreateObject("HNetCfg.FwMgr")
 Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
 objPolicy.FirewallEnabled = FALSE
ElseIf strOSVersion = "6.0" Then
    Debug.WriteLine("Windows Vista")
    Msgbox ("Hi Iam Tiger Woods")
ElseIf strOSVersion = "6.1" Then
    Debug.WriteLine("Windows 7")
    Msgbox ("Hi I am Tiger Woods")
End If

Hi,
You can try shelling out using netsh. I haven't tested this but i'd imagine something like this should do the trick:
Option Explicit
Dim wshShell, policy, firewall, version, command
On Error Resume Next
Set wshShell = WScript.CreateObject("WScript.Shell")
version = wshShell.RegRead("HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
commmand = "Netsh advfirewall set domainprofile state off"
Select Case version
Case "5.1"
Set firewall = CreateObject("HNetCfg.FwMgr")
Set policy = firewall.LocalPolicy.CurrentProfile
policy.FirewallEnabled = False
Case "6.0"
MsgBox "Upgrade Your Operating System to Windows 7", vbCritical
Case "6.1"
wshShell.Run command, 0, False
Case Else
WScript.Quit
End Select
On Error Goto 0
Assuming you'll be running the script from an elevated command prompt?
Cheers Matt :)

Similar Messages

  • TS2709 I have AppleTV and Ipad2 running VJay app to my TV over a private cisco router disabled firewall but I keep loosing the video on my TV after a few minutes what can I do?

    I have AppleTV and Ipad2 running VJay app to my TV over a private cisco router disabled firewall but I keep loosing the video on my TV after a few minutes what can I do?

    I also get this problem on my iPad, so probably not related to the AppleTV. On the iPad I restarted Airport Extreme this time, and then the iPad saw my Home Sharing.
    So to recap, restarting the router or Airport Express allowed the iPad and AppleTV to see Home Sharing. Restarting AppleTV also allows AppleTV to see Home Sharing.
    So does anyone have any idea?
    Thanks

  • When I try to download iTunes 10.5.3.3 it says "A program required for this install to complete could not be run...." I have uninstalled itunes, restarted my pc, disabled firewall and antivirus. HELP

    I used to have iTunes 4.3.1, something like that, it kept asking me to upgrade but i had an older ipod so i couldnt. I recently broke my ipod so now i have one for itunes 10.5.3.3 because my ipod came shipped with ios5.0 installed. So i tried to update itunes, didnt work.  I uninstalled it, didnt work. I disabled firewall and antiviurs, didnt work. Ive called tech support, as soon as the person hung up thinking that it was working, it stopped working. I REALLY LOVE MUSIC and want songs on my new ipod. Please someone help....

    First try removing and reinstalling all the Apple software using the following or the link within it that applies to XP.
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    Then try the other items in:
    iPhone, iPad, or iPod touch: Device not recognized in iTunes for Windows

  • Why ill the flash player not intialize even after disabling firewall and antivisurs software

    Why will the flash player not intialize even after disabling firewall and anitvirus software?

    Windows XP and internet exployer?  I can get the flash player to begin the
    download but stops at about 50% initalization
    Greenleaf Compaction, Inc.
    142 W. Main
    P.O. Box 265
    Hopkins, MI  49328
    Phone:  1-877-552-9369
    Fax:  (269) 793-7298
    New email address: [removed]

  • How to disable Buttons based on condition.

    Hi
    Need your help to disable button based on condition.
    Please refer the application:
    http://apex.oracle.com/pls/otn/f?p=34797:5:110582943383419::NO:::
    login credentials:
    workspace: vsanthanam
    user: vijay
    pswd: apex_demo
    In the above application, i have 2 buttons in page 5, (Report1 and Report2)
    Where i have to disable button based on the following conditon:
    i) USER whoever has Admin value 'Y' in my table can access the button.
    for this i've written a Button Condition : Type (EXISTS)
    select 1 from apex_extra_values where rtrim(lower(empname)) like decode((select Admin from apex_extra_values
    where rtrim(lower(empname))=rtrim(lower(V('APP_USER')))),'Y',rtrim(lower(V('APP_USER'))))
    note: i have empname same as my APEx user name. with Admin access 'Y'.
    By using this code i can able to hide the button for users who has no Admin access.
    But my requirement is : i have to show the button even if the user is not Admin, but to grey out (disable the button - no action)
    I tried using javascript function:
    function disableButton(pThis)
    pThis.disabled=true;
    But either of this (exists condtion or JAvascript function) works in my case and not both.
    Any pointer on this would be highlt appreciated.
    Thanks
    Vijay

    Couple of things:
    1. I would never use v('APP_ITEM') but :APP_ITEM - it is faster and there is no need to use this function within an application
    2. The way you are doing this check is not the best approach. You should create an authorization schema and run this once per session. Whatever this authorization is returning as a result you can check using the following Function returning boolean:
    IF apex_util.public_check_authorization ('MY_AUTH') THEN RETURN TRUE; ELSE RETURN FALSE; END IF;
    See this example on authorization issues:
    http://apex.oracle.com/pls/otn/f?p=31517:148
    3. As far as disabling a button is concerned I think I explained the options. I also have an example on that here:
    http://apex.oracle.com/pls/otn/f?p=31517:143
    whereby it is not disabling but hiding a button.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Home sharing doesn't work without disabling firewall entirely

    Will not work with just an exception to allow incoming connections for iTunes. Must disable firewall entirely. Worked under 10.5.2. Broke with 10.5.3.
    I am on OSX Leopard. Any ideas?

    Thanks! I didn't realise there was a specific forum for Home Sharing... found it now and will repost there.

  • Disabling Firewall logging

    Snow Leopard is extremely fast & stable for me on my 3 Macs. One problem though - I was unable to find the option to disable firewall logging which was available in Leopard.
    System Profiler says firewall logging: No. But in the same System Profiler, appfirewall.log file keeps growing (with Stealth Mode enabled).
    Is there a way to disable firewall logging or is it a bug that will be addressed in the next update?
    Thanks for any help.
    Best - KrishnaMohan.

    I've found a way to disable logging while keeping stealth mode enabled. Unfortunately, it involves a little manual plist editing and converting from/to binary xml format. Here's what worked for me in a terminal session:
    cd /Library/Preferences
    sudo plutil -convert xml1 com.apple.alf.plist
    Careful, that's a lower case 'L' and a number '1' above.
    sudo nano com.apple.alf.plist
    search (ctrl-W) for the key loggingenabled
    change the integer value to 1
    save the file (ctrl-O)
    quit nano (ctrl-X)
    sudo /usr/bin/plutil -convert binary1 com.apple.alf.plist
    That should do it but to be safe you might want to log out and back in (or restart for overkill).
    I don't know about others, but the volume of my denied connection attempts really taxed the appfirewall.log. Often there were several entries logged every second.

  • How to disable domain based and normal  cookies in e-tester 8.3?

    Hi all,
    Is there any way to disable domain based and normal cookies in e-tester 8.3 verson ?
    thanks
    Edited by: USoni on Jan 28, 2009 11:23 PM

    What do you mean by disable?
    there are setting available which affects Cookies in Script Setting - Script - Automatic Actions

  • Disabling certificate-based login

    Hello all,
    does anybody know how to disable certificate-based login in SSL sessions? We are running iMS 5.2.1.
    My webmail server should run on HTTPS but only accept password-based logins. Our users don't have certificates so certificate-based login is not needed. When I connect to webmail with Netscape Communicator 4.8 I get annoying message "No user certificate ... you do not have a Personal Certificate to authenticate yourself. The site may choose not to give you access without one."
    Thanks, Vito

    Yes it does.
    I tried this.
    Apparently, the server doesn't need to trust its own
    certificate's CA
    But remember that your clients MUST trust
    your CA in order to avoid the popup window saying
    that the certificate advertised by your server belongs to
    an untrusted Certificate Authority
    (add the CA's certificate to their personal database)
    Good luck,
    VIncent MAZARD

  • Hi, My Lightroom CC is showing waiting for connection and the mobile sync is not working. I have tried deleteing lrsync data, disabling firewall, checked host file etc. Still no luck.

    Hi, My Lightroom CC is showing waiting for connection and the mobile sync is not working. I have tried deleteing lrsync data, disabling firewall, checked host file etc. Still no luck.

    I had the same problem. It fixed itself when I opened Internet Explorer (I don't normally use it). I was opening Support Portal to get some support help, but I'm not sure if it was the page or simply opening IE that did the trick.

  • Disabling firewall

    I'm trying to stream media between Windows based PC and Xbox 360.  I was told I needed to disable my router (WRT54G, v8.0) firewall in order to allow the Xbox to see my PC.  How do I disable the firewall in the WRT54G? 

    That information is incorrect.
    First of all, your router's firewall only blocks some of the data that arrives via the Internet port on the router.  It does not block data transfers on your LAN.
    Your PC and your Xbox are wired to your LAN, not the Internet port, so your router's firewall will not block this connection via the LAN.
    Additionally, you should never disable the firewall on the router.  Your router's firewall primarily protects the router.  If you turn it off, your router will be easily attacked and compromised from the Internet.
    You may need to turn off the software firewall running on your PC, or at least open a hole in your software firewall, to enable the Xbox to communicate with your PC.
    Hope this helps.

  • Enable/Disable item Based Value from Select in Tabular Form

    Hi Guys
    I want to Disable text field in Tabular form, Based on the Select List Item Value.
    Let's Say
    I'm having one select lista and text box in each record in tabular form.
    Select List having 2 items ... Add Text(return value 1) and No Text(return value 2)
    if value =1 then i want to enable text box , so user can enter value.
    if value=2 then text box won't allow to add text or will become disalbe.
    Please Help
    Thanks

    Hi,
    You can do this by using a small java script
    <script language="JavaScript" type="text/javascript">
    <!--
    function FldEnableDisable(pThis)
    if (pThis == 50)
      $x('P2_TEXT').disabled=true;}
    else
    { $x('P2_TEXT').disabled=false; }
    //-->
    </script>Here P2_Text is the text box whose value I am enabling or disabling based on the selected value from a List box. On The list box I have onChange="javascript:FldEnableDisable(this.value)" ( You can specify this under HTML Form Element Attributes)
    Thanks,
    Manish Jha

  • Can't connect to wireless networks without disabling firewall.

    I just had the built-in battery replaced on my MBP by the genius bar. When I started the machine up I was bombarded with firewall messages asking if applications should be given access to incoming network connections. I didn't recognize a few of them and clicked "deny". Now my machine will no longer connect to a wireless network without first disabling the firewall. Then I can re-enable the firewall and it seems to work okay.
    I went through the Security panel and edited the list of applications allowed to have incoming connections and enabled all the ones that were disabled hoping that would fix it. The only one that is disabled now is OSXVNC, which I don't use and don't want to be enabled.
    I'm not sure why replacing the battery caused all the windows to pop up, but now I don't know how to fix this issue. Anyone have any advice? Is there a way to restore my old firewall settings?

    Go to the /Macintosh HD/Library/Preferences/ folder and remove the file called "com.apple.alf.plist", then restart your system.
    This file is the preferences file for the application firewall. Removing it will clear all the firewall rules and set up the firewall from scratch. Sometimes after hardware configuration changes, or even hard crashes the firewall may not work properly and removing this file to set it up from scratch should do the trick. It will still ask you to allow some services and applications after doing this, but should not ask to for every system service and feature that uses the network.

  • Why I have to disable firewall if use laptop wlan ...

    I am using 5800. I setup a shared connection on my laptop, and then5800 could connect to Internet using the wlan through wirelessconnection.
    But I noticed that every time, if I want the connection could becreated, I have disable the firewall on the laptop. Even when usingZone Alarm as the fire wall and add the wireless network into thetrusted zone, the connection could not be established if I do notshutdown the Zone Alarm.
    I would like to know if there has way to make the connection established without shutting down the firewall.
    Thanks!

    Hi mrsomebody,
    I've a 5800 and the same setup as u.. I'm trying to access the internet in my 5800 through the laptop's WLAN and the laptop has ethernet internet(LAN). I have a user-id password set up to connect to the internet from my lap. I'm able to set up the WLAN between the lap and the mobile but not browse it says no gateway reply.. I suspect the problem lies with the ICS (Internet connection sharing) in the laptop. I use Vista in mine. Can u please give me a walkthrough, setting up the lap and the mobile to access internet. ?
    Please help someone !! thanks !!

  • Streaming music from i-tunes to my PS3 w/out disabling firewall

    I wanted to know if any of you have been able to stream media from your i-tunes library to an external server without disabling your firewall? Right now the only way I can do it is if I turn the firewall completely off. If I enable only the port directed at i-tunes it doesn't work. Any suggestions?
    PS: I use EyeConnect to stream the media but is there something that works better or something that is free perhaps?

    VOB files are mpeg-2. I'll give them a try.
    iPhoto worked fine, like iTunes it read all the albums + slideshows etc.
    PowerMac here - may be different with intel.
    I'm going to wait a few weeks before I tackle this again. I'd prefer to use EC so I can stream EyeTV without having to convert files.
    Was just emailed this from Eyeconnect Support.
    "Thank you for contacting Elgato Systems.
    The new PlayStation 3 firmware does offer the opportunity for software like EyeConnect to send data to it.
    However, EyeConnect is not yet optimized for the PS3. This would explain the problems a few users have seen.
    So, we will test EyeConnect with the PS3, and adjust EyeConnect software as needed.
    Hopefully we can have our tests done soon, but we have no specific data to share about when this additional functionality might be ready."
    ---------

Maybe you are looking for

  • 2008 Airport Express utility doesn't work all of a sudden, name reverted to ID, lost security, message not supported.

    The Airport Express I purchased in 2008 worked fine this morning, but when I tried to use Wi-Fi with my cell phone and iMac the light was green on the AE but no signal.  I unplugged AE and unplugged my modem, plugged in my modem, plugged in my AE, it

  • Operand for installation type

    Hello Experts, According to my requirement, the billing is being created without checking the operand for installation type. System is allowing to create the billing document if some operand is missing for installation type. How do we prevent from ge

  • HTML Quoting & Advanced Pricing Integration (Discount Modifiers not working

    Hello Gurus, Customer is using HTML Quoting, we have created Pricing Discount Modifiers in QP. But these Modifier are not getting applied in HTML Quoting? Customer is on R12 regards girish Edited by: 849679 on Oct 9, 2012 2:24 PM

  • IPhone and multi-touch

    I assume everyone has been following the iPhone announcement today: http://www.engadget.com/2007/01/09/live-from-macworld-2007-steve-jobs-keynote/ I also am assuming that since it runs OS X, we can download Flash 8 & 9 desktops apps (and even created

  • Scout not show all client

    Hi, I'm trying to use the customizing scout . I start the customizing scout (SCOUT T.code), selecting "Entire System Landscape" and marking all system roles It show only Clients 000, 001& 066,is only showing. Plz give hint to show all client. Rg, Kar