home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / Chip_2004-10_cd1.bin / chplus / guide / AppCompat-XPSP2.msi / _8A20A82799263F2E2F7D3C7DEA618834 / _7D56B3805BAA41539C58503233591B0E < prev    next >
Encoding:
Text File  |  2004-08-23  |  2.7 KB  |  58 lines

  1. '=================================================================================
  2. 'This script is part of the appendix to the Application Compatibility Testing and 
  3. 'Mitigation Guide for Windows XP Service Pack 2. Before using these scripts you 
  4. 'must read the appendix and all Readme.txt files provided with the scripts. The 
  5. 'scripts are designed as functional samples and will require extensive testing and
  6. 'some modification for use in a production environment.
  7. '
  8. 'For information on additional functionality to incorporate into the script, such 
  9. 'as error checking, go to:
  10. '
  11. 'http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28001169
  12. '
  13. 'or
  14. '
  15. 'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rmscpt/html/rmscpt.asp
  16. '
  17. 'As some of the scripts edit the registry it is important that their functionality and 
  18. 'impact on the machine environment is thoroughly tested before they are used in a 
  19. 'production environment.
  20. '================================================================================== 
  21. ' OpenProgram.vbs
  22. '
  23. ' Author: Jim Captainino, Terry Tull (Content Master)
  24. ' Date:   08/20/04
  25. ' Revision History:
  26. '    Date    Comment
  27. '    08/20/04    Initial version started
  28. '
  29. '
  30.  
  31. 'This script uses the NetSh command line utility to include a program in the Windows Firewall
  32. 'exception list.
  33. 'The NetSh command line utility also configures access limits to the program to specific
  34. 'computers or local subnet.
  35. 'For information on the NetSh command line utility see the Help and Support Center.
  36.  
  37. 'The WshShell.Run command is used to force sequential execution of the NetSh commands.
  38. 'This ensures that execution control does not release until all shell commands have completed processing.
  39.  
  40. 'Edit the value of Prog to configure the adding of an AllowedProgram, Edit the value of ProgName tomatch the 
  41. Prog = """C:\Program Files\Messenger\msmsgr.exe"""
  42. ProgName = " Windows Messenger "
  43.  
  44. 'Create a WshShell object
  45. Set WshShell = CreateObject("Wscript.Shell")
  46.  
  47. 'Use the Run method to run the NetSh command line utility with the Add AllowedProgram command,
  48. 'specifying the application executable. Edit this line to include the required program.
  49.  
  50. WshShell.Run("NetSh Firewall Add AllowedProgram " & Prog & ProgName),1,TRUE
  51.  
  52. 'Use the Run method to run the Netsh command line utility using parameter labels and specifying a
  53. 'group of computers that will have access with the program. Edit the line below to include the 
  54. 'required program and access scope.
  55. 'WshShell.Run("NetSh Firewall Add AllowedProgram Program = C:\MyAppDir\MyApp.exe Name = MyApp" _
  56. '& "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
  57.