status win32_logicaldisk

  • Thread starter Thread starter Markus Burri
  • Start date Start date
M

Markus Burri

Hello

I have trouble to get the status-information from the
local harddrives when using a script which queries the
drives by the win32_logicaldisk class.

When I launch the script below, various data show up, but
the status is missing. Similar, when I replace the * in
the select-query by the keyword "Status", I only get the
driveletter.
According to the Platform SDK documentation, the status
property should return the status of the queried disk.

You may copy the code below to a vbs-file and test it
using the command wscript <filename.vbs>

Anyone knows more ?? Thanks in Advance, Markus

*******************
on error resume next
set wmi = GetObject("winmgmts:")
if err.number<>0 then
MsgBox "The Windows Management Instrumentation (WMI) has
not been installed." & VBCR & VBCR & "You can download it
from" & VBCR & VBCR & "http://msdn.microsoft.com/msdn-
files/027/001/576/Search.asp" & VBCR & VBCR ,"WMI Example"
WScript.Quit
end if
on error goto 0

set result = wmi.ExecQuery("select * from
win32_LogicalDisk WHERE DriveType = 3")

' show data
for each object in result
' show all information
WScript.Echo object.getObjectText_
next
*******************
 
Back
Top