Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Script Daylight Savings Time

1 réponse
Avatar
Rafi
Hello,
Nous appliquons sur notre domaine un script afin d'effectuer la mise à jour
dite DST et où il n'y a pas de patch pour les stations avec Windows 2000.
Cela correspond à ceci :
-> mise à jour Windows XP http://support.microsoft.com/kb/931836

J'ai juste un problème avec les stations windows 2000 en français: le box
des propriétés de date/heure avec les fuseaux horaires s'affiche lorsque le
script est lancé , et ceci seulement avec la langue française. En fait je
pense qu'il n'arrive pas à "re"sélectionner le fuseau horaire
Pourriez-vous me dire comment remédier à ceci ? Voici le début de ce script
:
"
Set WSHShell = wscript.CreateObject("WScript.Shell")
'Where do the reg files live?
stPathToRegFiles = "\\toto\timescript"

strComputer = "."
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery ("Select * from
Win32_OperatingSystem")
For Each objOperatingSystem in colSettings
stOSVer = objOperatingSystem.Version
stSvcPack = objOperatingSystem.ServicePackMajorVersion

Next

'this script is dependant upon the following files
'New_Timezone_Settings.reg
'New_timezoneInformation_Central.reg
'New_timezoneInformation_Eastern.reg
'New_timezoneInformation_Mountain.reg
'New_timezoneInformation_Pacific.reg
'New_timezoneInformation_Atlantic.reg
'New_timezoneInformation_Newfoundland.reg
'New_Timezone_UpdatedByMS.reg

'The New_timezone_Settings.reg includes the 2007 settings for all affected
time zones used in north america.
'The New_TimezoneInformation_xxxxx.reg contains the registry settings used
to update the machines currently selected time zone.

curZone = ""

'1 - Determine if XP SP2 or W2K3 has already been updated
on error resume next
stAlreadyUPdatedByMS = null
stAlreadyUpdatedByMS = WSHShell.RegRead ("HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Time Zones\Pacific Standard Time\Dynamic DST\2006")
if stAlreadyUpdatedByMS <> null then
WshShell.Run("%windir%\Regedit.exe /s " & stPathToRegFiles &
"\New_Timezone_UpdatedByMS.reg")
call WRiteToFile("3", "Failed", "*Machine Already Updated by MS Update")
wscript.quit(0)
end if

'2 - Determine if machine has already been updated via script or app.
on error resume next
stTimeZone = WSHShell.RegRead
("HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\StandardName")
WSHShell.Run "control.exe timedate.cpl,,/Z" & stTimeZone

stTZAlreadyUpdatedByScript = ""
stTZAlreadyUpdatedByScript = WSHShell.RegRead
("HKLM\SYSTEM\SETUP\2007_TimeZone_Updated")
if stTZAlreadyUpdatedByScript <> "" then
call WRiteToFile("2", "Failed", "*Machine Already updated by script or
app.")
wscript.quit(0)
end if

Et la partie du script qui semble ne pas fonctionner avec windows 2000 en
français :
"
("HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\StandardName")
WSHShell.Run "control.exe timedate.cpl,,/Z" & stTimeZone
"
Merci d'avance pour vos informations

Corialement

Rafi

1 réponse

Avatar
Gilles LAURENT
"Rafi" a écrit dans le message de
news:ubF3%
| Hello,

Bonjour,

| Nous appliquons sur notre domaine un script afin d'effectuer la mise
| à jour dite DST et où il n'y a pas de patch pour les stations avec
| Windows 2000. Cela correspond à ceci :
| -> mise à jour Windows XP http://support.microsoft.com/kb/931836
|
| J'ai juste un problème avec les stations windows 2000 en français: le
| box des propriétés de date/heure avec les fuseaux horaires s'affiche
| lorsque le script est lancé , et ceci seulement avec la langue
| française. En fait je pense qu'il n'arrive pas à "re"sélectionner le
| fuseau horaire

Il est nécessaire de déterminer le nom du fuseau horaire compatible avec
l'applet TimeDate.cpl. Le nom du fuseau horaire peut être soit le nom
affiché soit le nom standard. Ci-dessous une fonction VBScript
permettant de réaliser cette opération :

--- VBScript ---

Function TimeZoneStdName

Const HKLM=&h80000002
Const KEY="SOFTWAREMicrosoftWindows NTCurrentVersionTime Zones"
Set oSh=CreateObject("WScript.Shell")
Set oReg=GetObject("winmgmts:/root/default:StdRegProv")
strStd = oSh.RegRead("HKLMSYSTEMCurrentControlSetControl" & _
"TimeZoneInformationStandardName")
oReg.EnumKey HKLM,KEY,arrSubKeys
For Each strSubKey in arrSubKeys
If oSh.RegRead("HKLM" & KEY & "" & strSubKey & "Std")=strStd _
Then
TimeZoneStdName=strSubKey
End If
Next

End Function

--- VBScript ---

Et dans votre script :
WSHShell.Run "control.exe timedate.cpl,,/Z" & TimeZoneStdName

--
Gilles LAURENT
http://glsft.free.fr