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.
- '==================================================================================
- '
- ' StartRemoteIns.vbs
- '
- ' Author: Jim Captainino, Terry Tull (Content Master)
- ' Date: 08/20/04
- ' Revision History:
- ' Date Comment
- ' 08/20/04 Initial version started
-
- 'This script:
-
- 'Reads computer names from a text file
-
- 'Copies the installation and configuration scripts, including the XpSp2.exe upgrade file,
- 'from a network location to the local machine
-
- 'Connects to the computers in turn
-
- 'Launches install.cmd to start the installation process
-
- 'Before running the script change the scripts folder path, the computer.txt path and
- 'the install.cmd path to be correct for the environment
-
- 'Edit the value of CompTxtFile to configure the path to Computers.txt if required
- CompTxtFile = "C:\sp2share\scripts\scenario1\computers.txt"
-
- 'The XpSp2 upgrade executable, xpsp2.exe, needs to be present in the scripts folder
- 'Edit the value of SrcSrv to include the path to the scripts folder on the source server
- SrcSrv = "\\xpsp2-lb-domn-01\sp2share\scripts"
-
- 'Edit the value of DestPath to include the destination path on the client if required
- DestPath = "\c$\scripts"
-
- 'Edit the value of ScriptPath to include the path to Install.cmd if required
- ScriptPath = "\c$\scripts\scenario1\install.cmd"
-
- Set FileSys = CreateObject("Scripting.FileSystemObject")
-
- Set File = FileSys.GetFile(CompTxtFile)
-
- Set Words = File.OpenAsTextStream
-
- Do Until Words.AtEndOfStream
- StrComputer = Words.ReadLine
-
- 'The XpSp2 upgrade executable, xpsp2.exe, needs to be present in the scripts folder.
- 'Edit this line to include the path to the scripts folder on the source server and the
- 'destination path on the client if required
- FileSys.CopyFolder SrcSrv, "\\" & strComputer & DestPath, true
-
- Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" _
- & strComputer & "\root\cimv2:Win32_Process")
-
- errReturn = objWMIService.Create("\\" & strComputer & ScriptPath, null, null, intProcessID)
-
- If errReturn = 0 Then
- Wscript.Echo "Script ran successfully"
- Else
- Wscript.Echo "The script failed due to error " & errReturn & "."
- End If
- Loop