wmi experts

Thought this was working, but second glance shows 'no'...
I'm running this on a server in EST.  The .CurrentTimeZone should reveal -300, but shows -240 instead.

set oQuery=oWMI.ExecQuery("select * from Win32_ComputerSystem")
wscript.echo .CurrentTimeZone

Any idea(s) why?
LVL 67
sirbountyAsked:
Who is Participating?
 
cookreCommented:
Sounds like the server allows for daylight time, before which ET is GMT-5, after which it's GMT-4.
0
 
sr75Commented:
Why do you need the TimeZone??

Try using Win32_TimeZone anyways and see if you get a change.

<  script >

Option Explicit

Dim objWMI
Dim colClass
Dim objClass
Dim strComputer

strComputer = "."
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colClass = objWMI.ExecQuery("Select * from Win32_TimeZone",,48)

On Error Resume Next

For Each objClass in colClass
      WScript.Echo "Bias: " & objClass.Bias
Next

Set objWMI = Nothing
Set colClass = Nothing
Set objClass = Nothing
0
 
sr75Commented:
using objClass.Description will print out the selection for the timezone as well (i.e. eastern, pacific, etc.)
0
 
sirbountyAuthor Commented:
Completely forgot about that...<g>...thanx.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.