polycorjsp
asked on
VBS script InstallDate
Hi!
Is it possible to link a txt document to a vbs script? I have 200 computers and I want to know the Install Date of the OS. I have to modify the script for each computer...
strComputer = "ba01infodev"
Set dtmInstallDate = CreateObject( _
"WbemScripting.SWbemDateTi me")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper sonate}!\\ " _
& strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
MsgBox "Install Date: " & getmydat (objOperatingSystem.Instal lDate)
Next
Function getmydat(wmitime)
dtmInstallDate.Value = wmitime
getmydat = dtmInstallDate.GetVarDate
End function
Thanks!
JS
Is it possible to link a txt document to a vbs script? I have 200 computers and I want to know the Install Date of the OS. I have to modify the script for each computer...
strComputer = "ba01infodev"
Set dtmInstallDate = CreateObject( _
"WbemScripting.SWbemDateTi
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
& strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
MsgBox "Install Date: " & getmydat (objOperatingSystem.Instal
Next
Function getmydat(wmitime)
dtmInstallDate.Value = wmitime
getmydat = dtmInstallDate.GetVarDate
End function
Thanks!
JS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
~bp