robin42p
Messages postés19Date d'inscriptiondimanche 26 janvier 2003StatutMembreDernière intervention19 décembre 2008
-
19 déc. 2008 à 01:10
robin42p
Messages postés19Date d'inscriptiondimanche 26 janvier 2003StatutMembreDernière intervention19 décembre 2008
-
19 déc. 2008 à 08:17
Bonjour,
Je débute dans l'utilisation d'une interface HTA + VBS.
Je souhaite afficher à la volée différentes infos liées à la config de l'ordinateur en cours (processeur, mémoire, services, processus, etc...)
Mon problème se situe au niveau de l'affichage dynamique, qui ne l'est pas pour le moment ...
Le script est défini dans le "head" et celui-ci est chargé de cette façon
Voici la fonction qui rajoute une ligne dans le div principal :
Function AddL(strField, strValue)
Set o = document.getElementById("log")
o.innerHTML = o.innerHTML & "
" & strField & " : " & strValue & "
"
End Function
Actuellement le résultat de ma div s'affiche uniquement une fois que le script VBS est complètement terminé et ce n'est pas très pratique (le script peut durer plusieurs dizaines de secondes)
robin42p
Messages postés19Date d'inscriptiondimanche 26 janvier 2003StatutMembreDernière intervention19 décembre 2008 19 déc. 2008 à 08:07
Pour l'histoire du même id, tu as raison Renfield, mais ce n'est qu'un test qui n'est pas optimisé, du coup il ne respecte pas les standards pour le moment.
Voici une petite partie de code (je l'ai simplifié mais ça fait pareil)
Set col = objWMI.InstancesOf("Win32_OperatingSystem")
For Each obj In col
AddL "Nom d'hôte" , obj.CSName
AddL "Systeme d'exploitation" , obj.Caption
AddL "Version" , obj.Version
AddL "Nom du propriétaire" , obj.RegisteredUser
AddL "Dossier Windows" , obj.WindowsDirectory
AddL "Dossier Systeme" , obj.SystemDirectory
AddL "Mémoire Physique" , round(obj.TotalVisibleMemorySize / 1024) & " MB"
AddL "Pagination Max" , round(obj.TotalVirtualMemorySize / 1024) & " MB"
Next
Set col = objWMI.ExecQuery("Select * from Win32_Processor")
For Each obj In col
AddL "Processeur", obj.Name
AddL "Fréquence CPU max", obj.MaxClockSpeed & "MHz"
Next
Set obj = objWMI.InstancesOf("Win32_Service")
For each col In obj
AddL col.Caption, col.Started
Next
Set obj = Nothing
Set col = Nothing
Set objWMI = Nothing
End Function
Function AddL(strField, strValue)
Set o = document.getElementById("log")
o.innerHTML = o.innerHTML & strField & " : " & strValue & "
"
End Function
Set col = objWMI.InstancesOf("Win32_OperatingSystem")
For Each obj In col
AddL "Nom d'hôte" , obj.CSName
AddL "Systeme d'exploitation" , obj.Caption
AddL "Version" , obj.Version
AddL "Nom du propriétaire" , obj.RegisteredUser
AddL "Dossier Windows" , obj.WindowsDirectory
AddL "Dossier Systeme" , obj.SystemDirectory
AddL "Mémoire Physique" , round(obj.TotalVisibleMemorySize / 1024) & " MB"
AddL "Pagination Max" , round(obj.TotalVirtualMemorySize / 1024) & " MB"
Next
Set col = objWMI.ExecQuery("Select * from Win32_Processor")
For Each obj In col
AddL "Processeur", obj.Name
AddL "Fréquence CPU max", obj.MaxClockSpeed & "MHz"
Next
Set col = objWMI.InstancesOf("Win32_Service")
For each obj In col
AddL obj.Caption, obj.Started
Next
Set obj = Nothing
Set col = Nothing
Set objWMI = Nothing
End Function
Function AddL(strField, strValue)
Set o = document.getElementById("log")
o.innerHTML = o.innerHTML & strField & " : " & strValue & "
"
End Function