ggreen681
Posts: 53
Score: 3 Joined: 9/24/2001 From: Cleveland, OH Status: offline
|
Sorry it took so long to respond but I was out for a couple of days. Anyway here is a workaround that I intend to use in my environment. Connect to the PC using the local administrator account. In my environment that account is on 99% of all our desktops so I just use that account to connect. I have highlighted the changes I made to your script. Const ForReading = 1 Const ForWriting = 2 On Error Resume Next Dim objXL Set objXL = WScript.CreateObject(" Excel.Application" ) objXL.Visible = TRUE objXL.WorkBooks.Add objXL.Columns(1).ColumnWidth = 20 objXL.Columns(2).ColumnWidth = 45 objXL.Cells(1, 1).Value = " Workstation Name" objXL.Cells(1, 2).Value = " MDAC Version" objXL.Range(" A1:B1" ).Select objXL.Selection.Font.Bold = True objXL.Selection.Interior.ColorIndex = 9 objXL.Selection.Interior.Pattern = 1 ' xlSolid objXL.Selection.Font.ColorIndex = 2 objXL.Columns(" B:B" ).Select objXL.Selection.HorizontalAlignment = &hFFFFEFDD ' xlLeft Dim intIndex intIndex = 2 Dim strComputer, strValue Dim lRC1, lRC2, lRC3 Dim sPath1 Dim oArgs Dim IEVer, IEPatch Dim objSystemSet, objSystem Dim strInputFileName, strOutputFileName strInputFileName = InputBox(" Enter the name of the text file with the list of computers" ) strInputFileName = objArgs(0) strOutputFileName = objArgs(1) Dim objFSO, objInputFile, objOutputFile Set objFSO = CREATEOBJECT(" Scripting.FileSystemObject" ) Set objInputFile = objFSO.OpenTextFile(strInputFileName,ForReading,False) Set objOutputFile = objFSO.OpenTextFile(strOutputFileName,ForWriting,True) Const HKEY_LOCAL_MACHINE = &H80000002 While Not objInputFile.AtEndOfStream strOutput = " " strComputer = Trim(objInputFile.Readline) Err.Number = 0 Set oServices = WScript.CreateObject(" WbemScripting.SWbemLocator" ) Set oConn = oServices.ConnectServer(strComputer, " root\default" , _ strComputer & " \Administrator" , " Password Here" ) Set oReg = oConn.Get(" StdRegProv" ) If Err.Number <> 0 Then ' WScript.Echo " Error Number is " & Err.Number & " connecting to " & strComputer strValue = " Could not access Registry Provider" Call Show Else sPath1 = " SOFTWARE\Microsoft\DataAccess" lRC1 = oReg.GetStringValue(HKEY_LOCAL_MACHINE, sPath1, " FullInstallVer" , oVer) If (lRC1 = 0) Then strOutput = strOutput & strComputer & vbTab & oVer & " 1" ' WScript.Echo strOutput strValue = oVer Call Show Else strOutput = strOutput & strComputer & vbTab & " 4" ' WScript.Echo strOutput strValue = " Can' t determine version from registry" Call Show End If End If Wend Sub Show objXL.Cells(intIndex, 1).Value = strComputer objXL.Cells(intIndex, 2).Value = strValue intIndex = intIndex + 1 objXL.Cells(intIndex, 1).Select End Sub WScript.Quit
_____________________________
You mean that was a PRODUCTION server?!
|