home *** CD-ROM | disk | FTP | other *** search
- '=================================================================================
- 'This script is part of the appendix to the Application Compatibility Testing and
- 'Mitigation Guide for Windows XP Service Pack 2. Before using these scripts you
- 'must read the appendix and all Readme.txt files provided with the scripts. The
- 'scripts are designed as functional samples and will require extensive testing and
- 'some modification for use in a production environment.
- '
- 'For information on additional functionality to incorporate into the script, such
- 'as error checking, go to:
- '
- 'http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28001169
- '
- 'or
- '
- 'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rmscpt/html/rmscpt.asp
- '
- 'As some of the scripts edit the registry it is important that their functionality and
- 'impact on the machine environment is thoroughly tested before they are used in a
- 'production environment.
- '==================================================================================
- '
- ' OpenProgram.vbs
- '
- ' Author: Jim Captainino, Terry Tull (Content Master)
- ' Date: 08/20/04
- ' Revision History:
- ' Date Comment
- ' 08/20/04 Initial version started
- '
- '
-
- 'This script uses the NetSh command line utility to include a program in the Windows Firewall
- 'exception list.
- 'The NetSh command line utility also configures access limits to the program to specific
- 'computers or local subnet.
- 'For information on the NetSh command line utility see the Help and Support Center.
-
- 'The WshShell.Run command is used to force sequential execution of the NetSh commands.
- 'This ensures that execution control does not release until all shell commands have completed processing.
-
- 'Edit the value of Prog to configure the adding of an AllowedProgram, Edit the value of ProgName tomatch the
- Prog = """C:\Program Files\Messenger\msmsgr.exe"""
- ProgName = " Windows Messenger "
-
- 'Create a WshShell object
- Set WshShell = CreateObject("Wscript.Shell")
-
- 'Use the Run method to run the NetSh command line utility with the Add AllowedProgram command,
- 'specifying the application executable. Edit this line to include the required program.
-
- WshShell.Run("NetSh Firewall Add AllowedProgram " & Prog & ProgName),1,TRUE
-
- 'Use the Run method to run the Netsh command line utility using parameter labels and specifying a
- 'group of computers that will have access with the program. Edit the line below to include the
- 'required program and access scope.
- 'WshShell.Run("NetSh Firewall Add AllowedProgram Program = C:\MyAppDir\MyApp.exe Name = MyApp" _
- '& "Mode = ENABLE Scope = CUSTOM Addresses = 157.60.0.1,172.16.0.0/16,10.0.0.0/255.0.0.0,LocalSubnet"),1,TRUE
-