VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get the time zone info of the system using Win32_TimeZone WMI Class

by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Tue 11th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get the time zone info of the system using Win32_TimeZone WMI Class

Rate Get the time zone info of the system using Win32_TimeZone WMI Class



'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik

On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\Win32_TimeZone.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_TimeZone Class by Karthikeyan"
TextFile.WriteLine 
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_TimeZone",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
    TextFile.WriteLine "Bias: " & SubItems.Bias
    TextFile.WriteLine "Caption: " & SubItems.Caption
    TextFile.WriteLine "DaylightBias: " & SubItems.DaylightBias
    TextFile.WriteLine "DaylightDay: " & SubItems.DaylightDay
    TextFile.WriteLine "DaylightDayOfWeek: " & SubItems.DaylightDayOfWeek
    TextFile.WriteLine "DaylightHour: " & SubItems.DaylightHour
    TextFile.WriteLine "DaylightMillisecond: " & SubItems.DaylightMillisecond
    TextFile.WriteLine "DaylightMinute: " & SubItems.DaylightMinute
    TextFile.WriteLine "DaylightMonth: " & SubItems.DaylightMonth
    TextFile.WriteLine "DaylightName: " & SubItems.DaylightName
    TextFile.WriteLine "DaylightSecond: " & SubItems.DaylightSecond
    TextFile.WriteLine "DaylightYear: " & SubItems.DaylightYear
    TextFile.WriteLine "Description: " & SubItems.Description
    TextFile.WriteLine "SettingID: " & SubItems.SettingID
    TextFile.WriteLine "StandardBias: " & SubItems.StandardBias
    TextFile.WriteLine "StandardDay: " & SubItems.StandardDay
    TextFile.WriteLine "StandardDayOfWeek: " & SubItems.StandardDayOfWeek
    TextFile.WriteLine "StandardHour: " & SubItems.StandardHour
    TextFile.WriteLine "StandardMillisecond: " & SubItems.StandardMillisecond
    TextFile.WriteLine "StandardMinute: " & SubItems.StandardMinute
    TextFile.WriteLine "StandardMonth: " & SubItems.StandardMonth
    TextFile.WriteLine "StandardName: " & SubItems.StandardName
    TextFile.WriteLine "StandardSecond: " & SubItems.StandardSecond
    TextFile.WriteLine "StandardYear: " & SubItems.StandardYear
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Win32_TimeZone.txt",1,True


Download this snippet    Add to My Saved Code

Get the time zone info of the system using Win32_TimeZone WMI Class Comments

No comments have been posted about Get the time zone info of the system using Win32_TimeZone WMI Class. Why not be the first to post a comment about Get the time zone info of the system using Win32_TimeZone WMI Class.

Post your comment

Subject:
Message:
0/1000 characters