Probleme de reglage

Oxygene34 Messages postés 52 Date d'inscription mardi 27 janvier 2009 Statut Membre Dernière intervention 4 avril 2009 - 13 mars 2009 à 21:55
Oxygene34 Messages postés 52 Date d'inscription mardi 27 janvier 2009 Statut Membre Dernière intervention 4 avril 2009 - 14 mars 2009 à 11:22
bonjour a tous...

j'ecris ce message car je galère en vbs sur "WMI Tasks: Scheduled Tasks"

mon probleme est que je n'arrive pas a configurer l'heure de déclanchement du programme a cause de UTC
je comprend l'anglais mais la je pense que c'est plutot une faute de calcul ou autre

il y a des indications en dessous du code

je sais que c'est long mais aider moi !!!!!!!

merci

voici le code:
_________________________________________________________________________________________________
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" _
& strComputer & "\root\cimv2")
JobID = "Test"
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreate = objNewJob.Create _
("Notepad.exe", "********143000.000000-420", _
True , 1 OR 4 OR 16, ,True, JobId)
If errJobCreate = 0 Then
WScript.Echo "Job created successfully: " & VBNewLine _
& "Notepad.exe scheduled to run repeately at 14.30 (2:30 P.M.) PST" & VBNewLine _
& "on Mon, Wed, and Fri."
Else
WScript.Echo "Job not created. Error code = " & errJobCreate
End If

_________________________________________________________________________________________

il donne peu d'indication:

In the string "********143000.000000-420" (used in the StartTime
parameter value of the Create method), "********143000.000000"
specifies that the task starts at 14.30 (2:30 P.M.) and "-420"
specifies the time zone. The time zone number is the current bias of
the local time translation. The bias is the difference between the
UTC time and the local time. To calculate the bias for your time zone,
multiply the number of hours that your time zone is ahead or behind
Greenwich Mean Time (GMT) by 60 (use a positive number for the number
of hours if your time zone is ahead of GMT and a negative number if
your time zone is behind GMT). Add an additional 60 to your
calculation if your time zone is using daylight savings time.
For example, the Pacific Standard Time zone is eight hours behind
GMT, therefore the bias is equals to -420 (-8 * 60 + 60)
when daylight savings time is in use and -480 (-8 * 60)
when daylight savings time is not in use. You can also determine the
value of the bias by querying the bias property of the
Win32_TimeZone class.

pour plus d'info http://msdn.microsoft.com/en-us/library/aa394601%28VS.85%29.aspx

merci

5 réponses

Duke49 Messages postés 552 Date d'inscription jeudi 12 octobre 2006 Statut Non membre Dernière intervention 24 janvier 2023 4
14 mars 2009 à 00:30
Peut etre que l'API GetTimeZoneInformation pourrait t'aider a faire la conversion ?
0
Oxygene34 Messages postés 52 Date d'inscription mardi 27 janvier 2009 Statut Membre Dernière intervention 4 avril 2009
14 mars 2009 à 09:09
mais j'ai déjà essaye plusiueurs fois. Normalement a paris c'est utc +1 donc 60+60=120 non? Donc si c'est ça on doit avoir pour que elle s'exécute a 16h donc ********160000.0000+120 c'est ça? Pouriez vous m'expliquer pourquoi on ne declanche pas simplement l'application a l'heure de l'ordinateur?

Merci
0
Duke49 Messages postés 552 Date d'inscription jeudi 12 octobre 2006 Statut Non membre Dernière intervention 24 janvier 2023 4
14 mars 2009 à 10:13
Ton application ne doit pas être a usage local, voila pourquoi.
A la base WMI est justement là pour simplifier le temps mondial avec tous les providers pour des opérations composants ou pilotes. Au même moment avec le même code je réalise les mêmes choses n'importe ou.

Un exemple:
http://forum.hardware.fr/hfr/Programmation/VB-VBA-VBS/vbs-modification-permissions-sujet_103422_1.htm

Des outils:
http://www.microsoft.com/downloads/details.aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314&DisplayLang=en
0
Duke49 Messages postés 552 Date d'inscription jeudi 12 octobre 2006 Statut Non membre Dernière intervention 24 janvier 2023 4
14 mars 2009 à 10:16
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Oxygene34 Messages postés 52 Date d'inscription mardi 27 janvier 2009 Statut Membre Dernière intervention 4 avril 2009
14 mars 2009 à 11:22
bon logiciel... mais retour a la case depart: ne marche pas


tu devrais essayer et me dire comment tu fais parceque moi...


merci
0
Rejoignez-nous