Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  List  Portable  Battery  Information  

 Content of List Portable Battery Information.vbs
MD5 Hash: 0FBE6A7C6078823BC58EA8DF05D21D47
' Description: Returns information about any portable battery (such as the batteries used to power laptop computers) in use on a computer.


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

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a