Click here to Skip to main content
16,004,969 members
Home / Discussions / System Admin
   

System Admin

 
AnswerRe: Estimate time for scan disk Pin
Paul Conrad20-Nov-08 5:34
professionalPaul Conrad20-Nov-08 5:34 
QuestionDevices connected to USB ports Pin
David Crow19-Nov-08 8:37
David Crow19-Nov-08 8:37 
AnswerRe: Devices connected to USB ports Pin
Jörgen Andersson19-Nov-08 11:32
professionalJörgen Andersson19-Nov-08 11:32 
GeneralRe: Devices connected to USB ports Pin
David Crow21-Nov-08 18:52
David Crow21-Nov-08 18:52 
GeneralRe: Devices connected to USB ports Pin
Jörgen Andersson21-Nov-08 23:25
professionalJörgen Andersson21-Nov-08 23:25 
GeneralRe: Devices connected to USB ports Pin
David Crow22-Nov-08 3:47
David Crow22-Nov-08 3:47 
QuestionWMI query Pin
Le centriste19-Nov-08 5:50
Le centriste19-Nov-08 5:50 
AnswerRe: WMI query Pin
Uros Calakovic19-Nov-08 6:52
Uros Calakovic19-Nov-08 6:52 
SWbemObjectSet has the Count property. For example, this script:

Set objWMI = GetObject _
    ("winmgmts:root\cimv2")
    
Set colDisks = objWMI.ExecQuery _
     ("Select * From Win32_LogicalDisk " _
     & "Where DeviceId = 'C:'")

WScript.Echo colDisks.Count


will return 1. Count is not accessible when you use SWbemServices.ExecQuery with the wbemFlagForwardOnly flag:


Set objWMI = GetObject _
    ("winmgmts:root\cimv2")
    
Set colDisks = objWMI.ExecQuery _
     ("Select * From Win32_LogicalDisk " _
     & "Where DeviceId = 'C:'", , 48)

WScript.Echo colDisks.Count


This script returns this error:

SWbemObjectSet: Unspecified error


but it is difficult to guess what is wrong without seeing any code.

Is Nothing and IsNull don't help either because an empty result set is still a valid SWbemObjectSet object:


Set objWMI = GetObject _
    ("winmgmts:root\cimv2")
    
Set colDisks = objWMI.ExecQuery _
     ("Select * From Win32_LogicalDisk " _
     & "Where DeviceId = 'Blah'")

WScript.Echo colDisks.Count
WScript.Echo TypeName(colDisks)
WScript.Echo CStr(colDisks Is Nothing)
WScript.Echo CStr(IsNull(colDisks))


In January you said "Money in April" -
That was two years ago!

B. Python

GeneralRe: WMI query Pin
Le centriste19-Nov-08 7:34
Le centriste19-Nov-08 7:34 
GeneralRe: WMI query Pin
Uros Calakovic19-Nov-08 8:08
Uros Calakovic19-Nov-08 8:08 
QuestionVista Problem Pin
scorp_scorp19-Nov-08 1:45
scorp_scorp19-Nov-08 1:45 
QuestionRe: Vista Problem Pin
David Crow19-Nov-08 8:39
David Crow19-Nov-08 8:39 
QuestionRe: Vista Problem Pin
scorp_scorp20-Nov-08 1:06
scorp_scorp20-Nov-08 1:06 
AnswerRe: Vista Problem Pin
Randor 20-Nov-08 4:14
professional Randor 20-Nov-08 4:14 
QuestionDNS Forward Lookup and Windows 2008 Server DataCenter Pin
Ponzano Paolo18-Nov-08 23:13
Ponzano Paolo18-Nov-08 23:13 
QuestionService rights issue Pin
teopau18-Nov-08 16:32
teopau18-Nov-08 16:32 
QuestionHow can I set 1680*1050 resolution without DDC informations Pin
Figu.Lin17-Nov-08 22:28
Figu.Lin17-Nov-08 22:28 
AnswerRe: How can I set 1680*1050 resolution without DDC informations Pin
Dave Kreskowiak18-Nov-08 2:08
mveDave Kreskowiak18-Nov-08 2:08 
GeneralRe: How can I set 1680*1050 resolution without DDC informations Pin
Figu.Lin19-Nov-08 13:34
Figu.Lin19-Nov-08 13:34 
JokeRe: How can I set 1680*1050 resolution without DDC informations Pin
Paul Conrad2-Dec-08 10:59
professionalPaul Conrad2-Dec-08 10:59 
GeneralRe: How can I set 1680*1050 resolution without DDC informations Pin
Dave Kreskowiak2-Dec-08 11:35
mveDave Kreskowiak2-Dec-08 11:35 
JokeRe: How can I set 1680*1050 resolution without DDC informations Pin
Paul Conrad2-Dec-08 11:37
professionalPaul Conrad2-Dec-08 11:37 
GeneralRe: How can I set 1680*1050 resolution without DDC informations Pin
Figu.Lin28-Dec-08 19:21
Figu.Lin28-Dec-08 19:21 
Questionrar files on the mac Pin
sajjy17-Nov-08 10:26
sajjy17-Nov-08 10:26 
AnswerRe: rar files on the mac Pin
User 171649217-Nov-08 11:33
professionalUser 171649217-Nov-08 11:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.