home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / Chip_2004-10_cd1.bin / chplus / guide / AppCompat-XPSP2.msi / _8A20A82799263F2E2F7D3C7DEA618834 / _336AF455B3084958ADCB82BBE0A4BFB3 < prev    next >
Encoding:
Text File  |  2004-08-23  |  3.1 KB  |  81 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. ' StartRemoteIns.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. 'This script:
  30.  
  31. 'Reads computer names from a text file
  32.  
  33. 'Copies the installation and configuration scripts, including the XpSp2.exe upgrade file, 
  34. 'from a network location to the local machine
  35.  
  36. 'Connects to the computers in turn
  37.  
  38. 'Launches install.cmd to start the installation process
  39.  
  40. 'Before running the script change the scripts folder path, the computer.txt path and 
  41. 'the install.cmd path to be correct for the environment
  42.  
  43. 'Edit the value of CompTxtFile to configure the path to Computers.txt if required
  44. CompTxtFile = "C:\sp2share\scripts\scenario1\computers.txt"
  45.  
  46. 'The XpSp2 upgrade executable, xpsp2.exe, needs to be present in the scripts folder
  47. 'Edit the value of SrcSrv to include the path to the scripts folder on the source server
  48. SrcSrv = "\\xpsp2-lb-domn-01\sp2share\scripts"
  49.  
  50. 'Edit the value of DestPath to include the destination path on the client if required
  51. DestPath = "\c$\scripts"
  52.  
  53. 'Edit the value of ScriptPath to include the path to Install.cmd if required
  54. ScriptPath = "\c$\scripts\scenario1\install.cmd"
  55.  
  56. Set FileSys = CreateObject("Scripting.FileSystemObject")
  57.  
  58. Set File = FileSys.GetFile(CompTxtFile)
  59.  
  60. Set Words = File.OpenAsTextStream
  61.  
  62.     Do Until Words.AtEndOfStream
  63.     StrComputer = Words.ReadLine
  64.  
  65. 'The XpSp2 upgrade executable, xpsp2.exe, needs to be present in the scripts folder.
  66. 'Edit this line to include the path to the scripts folder on the source server and the
  67. 'destination path on the client if required
  68.     FileSys.CopyFolder SrcSrv, "\\" & strComputer & DestPath, true
  69.  
  70.     Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\"  _
  71.     & strComputer & "\root\cimv2:Win32_Process")
  72.  
  73.     errReturn = objWMIService.Create("\\" & strComputer & ScriptPath, null, null, intProcessID)
  74.  
  75.         If errReturn = 0 Then 
  76.          Wscript.Echo "Script ran successfully"
  77.         Else
  78.          Wscript.Echo "The script failed due to error " & errReturn & "."
  79.         End If
  80.     Loop