wmi experts

Posted on 2006-04-05
Last Modified: 2012-08-14
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?
Question by:sirbounty
    LVL 15

    Expert Comment

    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

    Set objWMI = Nothing
    Set colClass = Nothing
    Set objClass = Nothing
    LVL 15

    Expert Comment

    using objClass.Description will print out the selection for the timezone as well (i.e. eastern, pacific, etc.)
    LVL 23

    Accepted Solution

    Sounds like the server allows for daylight time, before which ET is GMT-5, after which it's GMT-4.
    LVL 67

    Author Comment

    Completely forgot about that...<g>...thanx.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now