Link to home
Start Free TrialLog in
Avatar of Dabosa
Dabosa

asked on

objComputer.?

.
I would like to have the timeand date also printed in txt file.
I cant seem to find a objcomputer.time&date. How do one actually find these properties or is it methods?
Its difficult to know what to use, is there a list somewhere to check what X do for obj.Computer.X?

For Each objComputer in colComputer
strComputer = objComputer.Name
TimeDate = objComputer.Time

Thanks very much! /D
Avatar of sirbounty
sirbounty
Flag of United States of America image

As an example:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jan05/hey0127.mspx

strComputer = "."
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_LocalTime")
 
For Each objItem in colItems
    Wscript.Echo "Month: " & objItem.Month
    Wscript.Echo "Day: " & objItem.Day
    Wscript.Echo "Year: " & objItem.Year
    Wscript.Echo "Hour: " & objItem.Hour
    Wscript.Echo "Minute: " & objItem.Minute
    Wscript.Echo "Second: " & objItem.Second
Next

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial