SUPINFO International University

SUPINFO Institute of Information Technology
Laboratoire Microsoft




Afficher les informations sur la batterie de votre portable

Accueil > Script > maintenance > Afficher les informations sur la batterie de votre portable

Afficher les informations sur la batterie de votre portable

Par Joachim GOMARD, LABORATOIRE SUPINFO DES TECHNOLOGIES MICROSOFT
Publiée le 25/10/2004 vers 13h.

Description :
Ce script VBS affiche les informations concernant la batterie de votre portable.

Script :

On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_PortableBattery")

For Each objItem in colItems
Wscript.Echo "Capacity Multiplier: " & objItem.CapacityMultiplier
Wscript.Echo "Chemistry: " & objItem.Chemistry
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Design Capacity: " & objItem.DesignCapacity
Wscript.Echo "Design Voltage: " & objItem.DesignVoltage
Wscript.Echo "Device ID: " & objItem.DeviceID
Wscript.Echo "Location: " & objItem.Location
dtmWMIDate = objItem.ManufactureDate
strReturn = WMIDateStringToDate(dtmWMIDate)
Wscript.Echo "Manufacture Date: " & strReturn
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Maximum Battery Error: " & objItem.MaxBatteryError
Wscript.Echo "Smart Battery Version: " & objItem.SmartBatteryVersion
Wscript.Echo
Next

Function WMIDateStringToDate(dtmWMIDate)
If Not IsNull(dtmWMIDate) Then
WMIDateStringToDate = CDate(Mid(dtmWMIDate, 5, 2) & "/" & _
Mid(dtmWMIDate, 7, 2) & "/" & Left(dtmWMIDate, 4) _
& " " & Mid (dtmWMIDate, 9, 2) & ":" & _
Mid(dtmWMIDate, 11, 2) & ":" & Mid(dtmWMIDate,13, 2))
End If
End Function



Proposer un script

Notre avis :

Votre avis :

Réactions :
0

Votants :
7

Visites :
10782

1
2
3
4
5




Retrouvez ci-dessous les autres sections du Laboratoire Microsoft