Created
April 12, 2010 21:04
-
-
Save sanxac/363995 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function WMIDateStringToDate(dtmInstallDate) | |
WMIDateStringToDate = _ | |
CDate(Mid(dtmInstallDate, 5, 2) &_ | |
"/" &_ | |
Mid(dtmInstallDate, 7, 2) &_ | |
"/" &_ | |
Left(dtmInstallDate, 4)) | |
End Function | |
Set objSWbemDateTime = _ | |
CreateObject("WbemScripting.SWbemDateTime") | |
objSWbemDateTime.SetVarDate #1/1/2006#, True | |
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:" & _ | |
"{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2") | |
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem") | |
For Each objItem in colItems | |
strComputer = objItem.Name | |
Next | |
Set objWMIService = GetObject("winmgmts:" & _ | |
"{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2") | |
Set colItems = objWMIService.ExecQuery("Select * from Win32_VideoController") | |
For Each objItem in colItems | |
strMsg = vbCrLf & "Machine Name:" & vbTab & strComputer & vbCrLf & vbCrLf _ | |
& "GFX Card:" & vbTab & objItem.Name & vbCrLf & vbCrLf _ | |
& "Driver Date:" & vbTab & WMIDateStringToDate(objItem.DriverDate) & vbCrLf & vbCrLf _ | |
& "Driver Version:" & vbTab & objItem.DriverVersion & vbCrLf & vbCrLf | |
Next | |
WScript.Echo strMsg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment