'vbScript 'This script is to identify the model name of the computer and 'copy across according drivers 'Created by Biji Zajac @ Walt Disney International 2011 '------------------------------------------------------------- Dim oFSO, oFS, MyModel, MySource, MyDest, MyCMD, MyWork Set oFSO = CreateObject("Scripting.FileSystemObject") Set WshShell = wScript.CreateObject("wScript.Shell") strComputer = "." MySource = "G:\DSLIB\Global\Drivers\WIN\Win7\" MyDest = "C:\DisneyIT\Tools\Packages\*.* /s /e /y" 'Create Output File 'Set oTSOut = oFSO.CreateTextFile("C:\DisneyIT\Product.txt") 'Setup WMI query Computer Syetem Product Properties for Name and Version Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct",,48) 'Query the local system For Each objItem in colItems If objItem.Vendor = "LENOVO" Then 'oTSOut.WriteLine objItem.Version MyModel = rTrim(objItem.Version) MySource = MySource & "IBM\" & MyModel MySource = MySource & "\*.*" MySource = CHR(34) & MySource & CHR(34) MyCMD = "CMD /C XCOPY " MyWork = MySource & " " & MyDest WshShell.Run MyCMD & MyWork Else 'oTSOut.WriteLine objItem.Name MyModel = rTrim(objItem.Name) MySource = MySource & "HP\" & MyModel MySource = MySource & "\*.*" MySource = CHR(34) & MySource & CHR(34) MyCMD = "CMD /C XCOPY " MyWork = MySource & " " & MyDest WshShell.Run MyCMD & MyWork End If Next Set oFS = Nothing 'Close File 'oTSOut.Close 'Completion Notification 'MsgBox "Finished."