Jump to content

Noob needs help scripting a compiled runas DST fix (.reg & .vbs)


Reinman
 Share

Recommended Posts

It should work. Maybe try

Run(@SystemDir & "\control.exe " & @SystemDir & "\timedate.cpl,,/Z")oÝ÷ ÚÚºÚ"µÍ[ÞÝ[Q  [È ][ÝÉÌLØÛÛÛ^H[YY]KÜÖ][ÝÊoÝ÷ ÚÚºÚ"µÍ[  ][ÝÐÎÌLÕÒS    ÌLÔÞÝ[LÌÌLØÛÛÛ^H[YY]KÜÖ][ÝÊoÝ÷ ÚÚºÚ"µÍ[   ][ÝÐÎÌLÕÒS    ÌLÔÞÝ[LÌÌLØÛÛÛ^HÎÌLÕÒS    ÌLÔÞÝ[LÌÌLÝ[YY]KÜÖ][ÝÊoÝ÷ Ù8^¢yr¶§ØbJÉÉ·ªºBÓÝ ÓSÓÝÊË^}´÷j®¢Ø¬b*.­×jém¥«aëH¶§ØZ·
.ٲ˩jYl¢»l¡û-¹÷è®f²mëay'+C¹rº"²z-­ën®x§Ø^®(!µØ«yËh¯ ´÷e4Ôô÷d²²×¦ßf(¹Æ§j[(¶¼¬zÛba{
+)àv*ÞrÚ+ÊX¤zØb±«­¢+ÙIÕ¸ ÅÕ½ÐíèÀäÈí]%99PÀäÈíMåÍÑ´ÌÈÀäÈí½¹Ñɽ°¹áÑ¥µÑ¹Á°°°½hÅÕ½Ðì°ÅÕ½ÐíèÀäÈí]%99PÀäÈíMåÍÑ´ÌÈÀäÈìÅÕ½Ðì¤

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

The winnt and system32 folders are in my path statement so I don't know why it couldn't find these. But when I tried the last example, it worked!

Run("C:\WINNT\System32\control.exe timedate.cpl,,/Z", "C:\WINNT\System32\")

I'll compile it now and test it on a sample system to see if it produces the desired results.

Thank you so much!

Link to comment
Share on other sites

Aaaah the sweet taste of success. I am not sure why it did that, I have never had to set the working directory before. Worked fine over here on a WinXP and 2K machine. Weird. Anywho, you can also add this code after it to close the window after it opens.

Opt("WinTitleMatchMode", 2) 
While 1
    Sleep(1)
    If WinExists("Time Properties") Then
        WinActivate("Time Properties")
        Send("{ENTER}")
        ExitLoop
    EndIf
WEnd
Link to comment
Share on other sites

Oh, and you may want to try doing it this way

Run(@SystemDir & "\control.exe timedate.cpl,,/Z", @SystemDir)
if it will work because it is a bad idea to use absolute pathnames. Are all your machines running Windows 2000? The registry keys and such are different for Win 9X than NT-based windowses.
Will do. I'll pick it back up on Monday.

Thanks again!

Link to comment
Share on other sites

Will do. I'll pick it back up on Monday.

Thanks again!

OK, the results are mixed. The command runs without errors. However, the desired outcome is incomplete.

In order for the timezone changes to be 'activated', the time zone must actually be 'refreshed'. Simply running the timedate.cpl does not refresh the timezone.

The steps to manually perform this task are as follows:

1 - Open the timedate.cpl

2 - On the TimeZone tab, change your timezone to anything else and click Apply.

3 - Change the timezone to your correct zone and click OK.

I suspect that the $szTzKey is needed in order to correctly reset the timezone to its previous setting. I have adjusted the line to now read:

Run(@SystemDir & "\control.exe timedate.cpl,,/Z" & $szTzKey, @SystemDir)

The line runs without error, however the desired timezone 'refresh' still does not happen.

Link to comment
Share on other sites

Strange. It has worked fine for me just opening and closing the Time Zone control panel applet. Below is the code I am adding to my remote that has worked fine on all WinXP and Win2K machines I have tested it on.

Run(@SystemDir & "\control.exe timedate.cpl,,/Z", @SystemDir)
Opt("WinTitleMatchMode", 2) 
While 1
    Sleep(1)
    If WinExists("Time Properties") Then
        WinActivate("Time Properties")
        Send("{ENTER}")
        ExitLoop
    EndIf
WEnd
Link to comment
Share on other sites

Is there another way that I can build this which would effectively 'runas' another user?

Remember that I'd prefer it to be self contained....

CODE
; ----------------------------------------------------------------------------

;

; VBScript to AutoIt Converter v0.4

;

; ----------------------------------------------------------------------------

$objSh = ObjCreate("WScript.Shell")

;Get the StandardName key of the current time zone

$szStandardName = $objSh.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\StandardName")

;Enumerate the subkeys in the time zone database

const $HKEY_LOCAL_MACHINE = &H80000002

$objReg=ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

$szTzsKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"

$objReg.EnumKey ($HKEY_LOCAL_MACHINE, $szTzsKeyPath, $arrTzSubKeys)

;Step through the time zones to find the matching Standard Name

$szTzKey = "<Unknown>"

For $subkey In $arrTzSubKeys

If ($objSh.RegRead("HKLM\" & $szTzsKeyPath & "\" & $subkey & "\Std") = $szStandardName) Then

;Found matching StandardName, now store this time zone key name

$szTzKey = $subkey

EndIf

Next

If $szTzKey = "<Unknown>" Then

;Write entry to the Application event log stating that the update has failed to execute

$objSh.LogEvent (1, "DST 2007 Registry Update and Refresh failed to execute on this computer. Time zones failed to enumerate properly or matching time zone not found.")

;VA Wscript.Quit 0

EndIf

;Launch control.exe to refresh time zone information using the TZ key name obtained above

$objSh.Run ("control.exe timedate.cpl,,/Z" & $szTzKey)

;Get current display name of refreshed time zone

$szCurrDispName = $objSh.RegRead("HKLM\" & $szTzsKeyPath & "\" & $szTzKey & "\Display")

;Write entry to the Application event log stating that the update has executed

$objSh.LogEvent (4, "DST 2007 Registry Update and Refresh has been executed on this computer." & chr(13) & chr(10) & chr(13) & chr(10) & "Current time zone is: " & $szCurrDispName & ".")

Something like, build the VB file local and runas admin then delete the file....

Edited by Reinman
Link to comment
Share on other sites

Try this - you will need the files noted in the FileInstall section for it to work. The reg file is from the MS kb article that should be imported and the XPSP2DSTFix.exe what I called the actual kb fix that works for sp2. If you have questions, let me know.

Please test as I am still testing.

D

Due to the 2007 daylight saving time adjustments, I'm attempting to deliver some registry changes then run a vbs script to a number of Windows 2000 systems. I'd like it to be in a single encrypted exe which includes admin credentials. That way I can distribute via email or add to the login script.

I need guidance to:

1 - Determine the best way to code it (call the reg file or build the file locally run it then remove it).

2 - Create the code itself. (syntax eats my lunch)

Any assistance is appreciated.

DSTFix.zip

Link to comment
Share on other sites

Try this - you will need the files noted in the FileInstall section for it to work. The reg file is from the MS kb article that should be imported and the XPSP2DSTFix.exe what I called the actual kb fix that works for sp2. If you have questions, let me know.

Please test as I am still testing.

D

I'm still holding out for a single file executable solution. But if I can't resolve it soon, I'll look into your suggestion.

Thanks for the input

Link to comment
Share on other sites

Here is my solution. It isn't very pretty or exotic but it works. It builds a local folder on drive C: and builds the two files recommended by microsoft and then runs them with elevated credentials. I've left the files in place so that the script won't run more than once.

Thanks for all the help. You guys were great!

CODE
RunAsSet("administrator", @ComputerName, "password")

If FileExists("C:\DST2007\DST2007.reg") Then

Exit

Else

$file1 = FileOpen("C:\DST2007\DST2007.reg", 10)

FileWriteLine($file1, 'Windows Registry Editor Version 5.00')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Alaskan Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-09:00) Alaska"')

FileWriteLine($file1, '"Dlt"="Alaskan Daylight Time"')

FileWriteLine($file1, '"Std"="Alaskan Standard Time"')

FileWriteLine($file1, '"MapID"="30,31"')

FileWriteLine($file1, '"Index"=dword:00000003')

FileWriteLine($file1, '"TZI"=hex:1c,02,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Alaskan Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:1c,02,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:1c,02,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,\')

FileWriteLine($file1, '0,00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Atlantic Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-04:00) Atlantic Time (Canada)"')

FileWriteLine($file1, '"Dlt"="Atlantic Daylight Time"')

FileWriteLine($file1, '"Std"="Atlantic Standard Time"')

FileWriteLine($file1, '"MapID"="40,41"')

FileWriteLine($file1, '"Index"=dword:00000032')

FileWriteLine($file1, '"TZI"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Atlantic Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\AUS Eastern Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+10:00) Canberra, Melbourne, Sydney"')

FileWriteLine($file1, '"Dlt"="AUS Eastern Daylight Time"')

FileWriteLine($file1, '"Std"="AUS Eastern Standard Time"')

FileWriteLine($file1, '"MapID"="20,21"')

FileWriteLine($file1, '"Index"=dword:000000ff')

FileWriteLine($file1, '"TZI"=hex:a8,fd,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,05,00,03,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Azerbaijan Standard Time]')

FileWriteLine($file1, '"TZI"=hex:10,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,05,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,05,00,04,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Azerbaijan Standard Time"')

FileWriteLine($file1, '"Dlt"="Azerbaijan Daylight Time"')

FileWriteLine($file1, '"Display"="(GMT+04:00) Baku"')

FileWriteLine($file1, '"Index"=dword:80000040')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Caucasus Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+04:00) Yerevan"')

FileWriteLine($file1, '"Dlt"="Caucasus Daylight Time"')

FileWriteLine($file1, '"Std"="Caucasus Standard Time"')

FileWriteLine($file1, '"MapID"="8,9"')

FileWriteLine($file1, '"Index"=dword:000000aa')

FileWriteLine($file1, '"TZI"=hex:10,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,03,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,05,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Cen. Australia Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+09:30) Adelaide"')

FileWriteLine($file1, '"Dlt"="Cen. Australia Daylight Time"')

FileWriteLine($file1, '"Std"="Cen. Australia Standard Time"')

FileWriteLine($file1, '"MapID"="-1,76"')

FileWriteLine($file1, '"Index"=dword:000000fa')

FileWriteLine($file1, '"TZI"=hex:c6,fd,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,05,00,03,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0a,00,00,00,05,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Brazilian Standard Time]')

FileWriteLine($file1, '"TZI"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,03,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0a,00,00,00,03,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Central Brazilian Standard Time"')

FileWriteLine($file1, '"Dlt"="Central Brazilian Daylight Time"')

FileWriteLine($file1, '"Display"="(GMT-04:00) Manaus"')

FileWriteLine($file1, '"Index"=dword:80000048')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Brazilian Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,02,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,0b,00,00,00,01,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,03,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0a,00,00,00,03,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-06:00) Central Time (US & Canada)"')

FileWriteLine($file1, '"Dlt"="Central Daylight Time"')

FileWriteLine($file1, '"Std"="Central Standard Time"')

FileWriteLine($file1, '"MapID"="36,37"')

FileWriteLine($file1, '"Index"=dword:00000014')

FileWriteLine($file1, '"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Central Standard Time (Mexico)]')

FileWriteLine($file1, '"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Central Standard Time (Mexico)"')

FileWriteLine($file1, '"Dlt"="Central Daylight Time (Mexico)"')

FileWriteLine($file1, '"Display"="(GMT-06:00) Guadalajara, Mexico City, Monterrey - New"')

FileWriteLine($file1, '"Index"=dword:80000043')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. Europe Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+02:00) Minsk"')

FileWriteLine($file1, '"Dlt"="E. Europe Daylight Time"')

FileWriteLine($file1, '"Std"="E. Europe Standard Time"')

FileWriteLine($file1, '"MapID"="4,5"')

FileWriteLine($file1, '"Index"=dword:00000073')

FileWriteLine($file1, '"TZI"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,03,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,05,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-03:00) Brasilia"')

FileWriteLine($file1, '"Dlt"="E. South America Daylight Time"')

FileWriteLine($file1, '"Std"="E. South America Standard Time"')

FileWriteLine($file1, '"MapID"="-1,80"')

FileWriteLine($file1, '"Index"=dword:00000041')

FileWriteLine($file1, '"TZI"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,05,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0b,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,02,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,0b,00,00,00,01,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,05,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,0b,00,00,00,01,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-05:00) Eastern Time (US & Canada)"')

FileWriteLine($file1, '"Dlt"="Eastern Daylight Time"')

FileWriteLine($file1, '"Std"="Eastern Standard Time"')

FileWriteLine($file1, '"MapID"="38,39"')

FileWriteLine($file1, '"Index"=dword:00000023')

FileWriteLine($file1, '"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Eastern Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Egypt Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+02:00) Cairo"')

FileWriteLine($file1, '"Dlt"="Egypt Daylight Time"')

FileWriteLine($file1, '"Std"="Egypt Standard Time"')

FileWriteLine($file1, '"MapID"="4,68"')

FileWriteLine($file1, '"Index"=dword:00000078')

FileWriteLine($file1, '"TZI"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,09,00,04,00,05,00,17,00,3b,\')

FileWriteLine($file1, '00,3b,00,00,00,00,00,04,00,04,00,05,00,17,00,3b,00,3b,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Georgian Standard Time]')

FileWriteLine($file1, '"TZI"=hex:4c,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Georgian Standard Time"')

FileWriteLine($file1, '"Dlt"="Georgian Daylight Time"')

FileWriteLine($file1, '"Display"="(GMT+03:00) Tbilisi"')

FileWriteLine($file1, '"Index"=dword:80000047')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Greenwich Standard Time]')

FileWriteLine($file1, '"Display"="(GMT) Casablanca, Monrovia, Reykjavik"')

FileWriteLine($file1, '"Dlt"="Greenwich Daylight Time"')

FileWriteLine($file1, '"Std"="Greenwich Standard Time"')

FileWriteLine($file1, '"MapID"="88,89"')

FileWriteLine($file1, '"Index"=dword:0000005a')

FileWriteLine($file1, '"TZI"=hex:00,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\GTB Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+02:00) Athens, Bucharest, Istanbul"')

FileWriteLine($file1, '"Dlt"="GTB Daylight Time"')

FileWriteLine($file1, '"Std"="GTB Standard Time"')

FileWriteLine($file1, '"MapID"="-1,67"')

FileWriteLine($file1, '"Index"=dword:00000082')

FileWriteLine($file1, '"TZI"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,04,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,05,00,03,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+02:00) Jerusalem"')

FileWriteLine($file1, '"Dlt"="Jerusalem Daylight Time"')

FileWriteLine($file1, '"Std"="Jerusalem Standard Time"')

FileWriteLine($file1, '"MapID"="-1,70"')

FileWriteLine($file1, '"Index"=dword:00000087')

FileWriteLine($file1, '"TZI"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,09,00,00,00,03,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,05,00,05,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d4')

FileWriteLine($file1, '"LastEntry"=dword:000007e7')

FileWriteLine($file1, '"2004"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2005"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,d5,07,0a,00,00,00,09,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,d5,07,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2006"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,d6,07,0a,00,00,00,01,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,d6,07,03,00,00,00,1f,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,d7,07,09,00,00,00,10,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,d7,07,03,00,00,00,1e,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2008"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,d8,07,0a,00,00,00,05,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,d8,07,03,00,00,00,1c,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2009"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,d9,07,09,00,00,00,1b,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,d9,07,03,00,00,00,1b,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2010"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,da,07,09,00,00,00,0c,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,da,07,03,00,00,00,1a,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2011"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,db,07,0a,00,00,00,02,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,db,07,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2012"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,dc,07,09,00,00,00,17,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,dc,07,03,00,00,00,1e,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2013"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,dd,07,09,00,00,00,08,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,dd,07,03,00,00,00,1d,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2014"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,de,07,09,00,00,00,1c,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,de,07,03,00,00,00,1c,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2015"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,df,07,09,00,00,00,14,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,df,07,03,00,00,00,1b,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2016"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,e0,07,0a,00,00,00,09,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,e0,07,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2017"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,e1,07,09,00,00,00,18,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,e1,07,03,00,00,00,1f,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2018"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,e2,07,09,00,00,00,10,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,e2,07,03,00,00,00,1e,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2019"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,e3,07,0a,00,00,00,06,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,e3,07,03,00,00,00,1d,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2020"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,e4,07,09,00,00,00,1b,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,e4,07,03,00,00,00,1b,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2021"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,e5,07,09,00,00,00,0c,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,e5,07,03,00,00,00,1a,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2022"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,e6,07,0a,00,00,00,02,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,e6,07,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2023"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Jordan Standard Time]')

FileWriteLine($file1, '"TZI"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,09,00,05,00,05,00,01,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,04,00,05,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Jordan Standard Time"')

FileWriteLine($file1, '"Dlt"="Jordan Daylight Time"')

FileWriteLine($file1, '"Display"="(GMT+02:00) Amman"')

FileWriteLine($file1, '"Index"=dword:80000042')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mexico Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-06:00) Guadalajara, Mexico City, Monterrey - Old"')

FileWriteLine($file1, '"Dlt"="Mexico Daylight Time"')

FileWriteLine($file1, '"Std"="Mexico Standard Time"')

FileWriteLine($file1, '"MapID"="-1,85"')

FileWriteLine($file1, '"Index"=dword:0000001e')

FileWriteLine($file1, '"TZI"=hex:68,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mexico Standard Time 2]')

FileWriteLine($file1, '"Display"="(GMT-07:00) Chihuahua, La Paz, Mazatlan - Old"')

FileWriteLine($file1, '"Dlt"="Mexico Daylight Time 2"')

FileWriteLine($file1, '"Std"="Mexico Standard Time 2"')

FileWriteLine($file1, '"MapID"="34,35"')

FileWriteLine($file1, '"Index"=dword:0000000d')

FileWriteLine($file1, '"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Middle East Standard Time]')

FileWriteLine($file1, '"TZI"=hex:88,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,06,00,05,00,17,00,3b,\')

FileWriteLine($file1, '00,3b,00,e7,03,00,00,03,00,00,00,05,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Middle East Standard Time"')

FileWriteLine($file1, '"Dlt"="Middle East Daylight Time"')

FileWriteLine($file1, '"Display"="(GMT+02:00) Beirut"')

FileWriteLine($file1, '"Index"=dword:80000041')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Montevideo Standard Time]')

FileWriteLine($file1, '"TZI"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,02,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0a,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Montevideo Standard Time"')

FileWriteLine($file1, '"Dlt"="Montevideo Daylight Time"')

FileWriteLine($file1, '"Display"="(GMT-03:00) Montevideo"')

FileWriteLine($file1, '"Index"=dword:80000049')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-07:00) Mountain Time (US & Canada)"')

FileWriteLine($file1, '"Dlt"="Mountain Daylight Time"')

FileWriteLine($file1, '"Std"="Mountain Standard Time"')

FileWriteLine($file1, '"MapID"="34,35"')

FileWriteLine($file1, '"Index"=dword:0000000a')

FileWriteLine($file1, '"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Mountain Standard Time (Mexico)]')

FileWriteLine($file1, '"TZI"=hex:a4,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Mountain Standard Time (Mexico)"')

FileWriteLine($file1, '"Dlt"="Mountain Daylight Time (Mexico)"')

FileWriteLine($file1, '"Display"="(GMT-07:00) Chihuahua, La Paz, Mazatlan - New"')

FileWriteLine($file1, '"Index"=dword:80000044')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Myanmar Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+06:30) Yangon (Rangoon)"')

FileWriteLine($file1, '"Dlt"="Myanmar Daylight Time"')

FileWriteLine($file1, '"Std"="Myanmar Standard Time"')

FileWriteLine($file1, '"MapID"="-1,74"')

FileWriteLine($file1, '"Index"=dword:000000cb')

FileWriteLine($file1, '"TZI"=hex:7a,fe,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Namibia Standard Time]')

FileWriteLine($file1, '"TZI"=hex:88,ff,ff,ff,00,00,00,00,3c,00,00,00,00,00,09,00,00,00,01,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Namibia Standard Time"')

FileWriteLine($file1, '"Dlt"="Namibia Daylight Time"')

FileWriteLine($file1, '"Display"="(GMT+02:00) Windhoek"')

FileWriteLine($file1, '"Index"=dword:80000046')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\New Zealand Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+12:00) Auckland, Wellington"')

FileWriteLine($file1, '"Dlt"="New Zealand Daylight Time"')

FileWriteLine($file1, '"Std"="New Zealand Standard Time"')

FileWriteLine($file1, '"MapID"="78,79"')

FileWriteLine($file1, '"Index"=dword:00000122')

FileWriteLine($file1, '"TZI"=hex:30,fd,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,03,00,03,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0a,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Newfoundland Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-03:30) Newfoundland"')

FileWriteLine($file1, '"Dlt"="Newfoundland Daylight Time"')

FileWriteLine($file1, '"Std"="Newfoundland Standard Time"')

FileWriteLine($file1, '"MapID"="-1,81"')

FileWriteLine($file1, '"Index"=dword:0000003c')

FileWriteLine($file1, '"TZI"=hex:d2,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,00,00,01,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,02,00,00,00,01,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Newfoundland Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:d2,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:d2,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific SA Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-04:00) Santiago"')

FileWriteLine($file1, '"Dlt"="Pacific SA Daylight Time"')

FileWriteLine($file1, '"Std"="Pacific SA Standard Time"')

FileWriteLine($file1, '"MapID"="-1,82"')

FileWriteLine($file1, '"Index"=dword:00000038')

FileWriteLine($file1, '"TZI"=hex:f0,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,03,00,06,00,02,00,17,00,3b,\')

FileWriteLine($file1, '00,3b,00,e7,03,00,00,0a,00,06,00,02,00,17,00,3b,00,3b,00,e7,03')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-08:00) Pacific Time (US & Canada)"')

FileWriteLine($file1, '"Dlt"="Pacific Daylight Time"')

FileWriteLine($file1, '"Std"="Pacific Standard Time"')

FileWriteLine($file1, '"MapID"="32,33"')

FileWriteLine($file1, '"Index"=dword:00000004')

FileWriteLine($file1, '"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0b,00,00,00,01,00,02,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,03,00,00,00,02,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Pacific Standard Time (Mexico)]')

FileWriteLine($file1, '"TZI"=hex:e0,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,0a,00,00,00,05,00,02,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,04,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '"Std"="Pacific Standard Time (Mexico)"')

FileWriteLine($file1, '"Dlt"="Pacific Daylight Time (Mexico)"')

FileWriteLine($file1, '"Display"="(GMT-08:00) Tijuana, Baja California"')

FileWriteLine($file1, '"Index"=dword:80000045')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\SA Pacific Standard Time]')

FileWriteLine($file1, '"Display"="(GMT-05:00) Bogota, Lima, Quito, Rio Branco"')

FileWriteLine($file1, '"Dlt"="SA Pacific Daylight Time"')

FileWriteLine($file1, '"Std"="SA Pacific Standard Time"')

FileWriteLine($file1, '"MapID"="-1,83"')

FileWriteLine($file1, '"Index"=dword:0000002d')

FileWriteLine($file1, '"TZI"=hex:2c,01,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Sri Lanka Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+05:30) Sri Jayawardenepura"')

FileWriteLine($file1, '"Dlt"="Sri Lanka Daylight Time"')

FileWriteLine($file1, '"Std"="Sri Lanka Standard Time"')

FileWriteLine($file1, '"MapID"="-1,74"')

FileWriteLine($file1, '"Index"=dword:000000c8')

FileWriteLine($file1, '"TZI"=hex:b6,fe,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Tasmania Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+10:00) Hobart"')

FileWriteLine($file1, '"Dlt"="Tasmania Daylight Time"')

FileWriteLine($file1, '"Std"="Tasmania Standard Time"')

FileWriteLine($file1, '"MapID"="20,-1"')

FileWriteLine($file1, '"Index"=dword:00000109')

FileWriteLine($file1, '"TZI"=hex:a8,fd,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,05,00,03,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0a,00,00,00,01,00,02,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Australia Standard Time]')

FileWriteLine($file1, '"Display"="(GMT+08:00) Perth"')

FileWriteLine($file1, '"Dlt"="W. Australia Daylight Time"')

FileWriteLine($file1, '"Std"="W. Australia Standard Time"')

FileWriteLine($file1, '"MapID"="16,17"')

FileWriteLine($file1, '"Index"=dword:000000e1')

FileWriteLine($file1, '"TZI"=hex:20,fe,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,05,00,03,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0c,00,00,00,01,00,03,00,00,00,00,00,00,00')

FileWriteLine($file1, '')

FileWriteLine($file1, '[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\W. Australia Standard Time\Dynamic DST]')

FileWriteLine($file1, '"FirstEntry"=dword:000007d6')

FileWriteLine($file1, '"LastEntry"=dword:000007d7')

FileWriteLine($file1, '"2006"=hex:20,fe,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00')

FileWriteLine($file1, '"2007"=hex:20,fe,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,05,00,03,00,00,\')

FileWriteLine($file1, '00,00,00,00,00,00,00,0c,00,00,00,01,00,03,00,00,00,00,00,00,00')

FileClose($file1)

EndIf

Sleep(1000)

RunWait("regedit /s C:\DST2007\DST2007.reg", "C:\DST2007\")

Sleep(1000)

If FileExists("C:\DST2007\DST2007.vbs") Then

Exit

Else

$file2 = FileOpen("C:\DST2007\DST2007.vbs", 10)

FileWriteLine($file2, 'Set objSh = CreateObject("WScript.Shell")')

FileWriteLine($file2, 'szStandardName = objSh.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\StandardName")')

FileWriteLine($file2, 'const HKEY_LOCAL_MACHINE = &H80000002')

FileWriteLine($file2, 'Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")')

FileWriteLine($file2, 'szTzsKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"')

FileWriteLine($file2, 'objReg.EnumKey HKEY_LOCAL_MACHINE, szTzsKeyPath, arrTzSubKeys')

FileWriteLine($file2, 'szTzKey = "<Unknown>"')

FileWriteLine($file2, 'For Each subkey In arrTzSubKeys')

FileWriteLine($file2, 'If (objSh.RegRead("HKLM\" & szTzsKeyPath & "\" & subkey & "\Std") = szStandardName) Then')

FileWriteLine($file2, 'szTzKey = subkey')

FileWriteLine($file2, 'End If')

FileWriteLine($file2, 'Next')

FileWriteLine($file2, 'If szTzKey = "<Unknown>" Then')

FileWriteLine($file2, 'objSh.LogEvent 1, "DST 2007 Registry Update and Refresh failed to execute on this computer. Time zones failed to enumerate properly or matching time zone not found."')

FileWriteLine($file2, 'Wscript.Quit 0')

FileWriteLine($file2, 'End If')

FileWriteLine($file2, 'objSh.Run "control.exe timedate.cpl,,/Z" & szTzKey')

FileWriteLine($file2, 'szCurrDispName = objSh.RegRead("HKLM\" & szTzsKeyPath & "\" & szTzKey & "\Display")')

FileWriteLine($file2, 'objSh.LogEvent 4, "DST 2007 Registry Update and Refresh has been executed on this computer." & chr(13) & chr(10) & chr(13) & chr(10) & "Current time zone is: " & szCurrDispName & "."')

FileClose($file2)

EndIf

sleep(1000)

RunWait("wscript.exe C:\DST2007\DST2007.vbs", "C:\DST2007\")

Sleep(1000)

Link to comment
Share on other sites

Is there areason why no one is usingthe Microsoft patch that is available KB931836? I am wondering because the scriptingwould be a lot easier than what I am seeing on here.

I am trying to execute this in a group policy so that my users do not have to do anything. Only a handful of our 600 users have admin rights, so I am using runasset to get admin rights to run the needed files. My main concern is obviously that it works and I do not have to go back and do any clean up.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...