Re: why does this wmi query take 10 minutes on a dual proc 2GB memory raid 1 15K scsi server?



unfortunately cim_datafile is very slow and the only way to speed it up
is to be more selective on what you're looking for. If you are checking
for the existence of a folder or file then you should use the
filesystemobject, though not WMI, it should be much faster.

kTell wrote:
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From CIM_Datafile WHERE Name LIKE
'C:\\DBRVSM\\Backups\\RVSM[_]Course[_]Activation[_]20061211%'")

If colFiles.Count > 0 Then
msgbox "The File DOES exist."
'Wscript.Echo "The file does exist."
Else
msgbox "The File does NOT exist."
'Wscript.Echo "The file does not exist."
End If


=====================

There are only 3 files in the directory, and this thing chomps up 20%
cpu and runs for 10 minutes before it finallllllly msgboxes me.
Whiskey Tango Foxtrot? Worthless is what I say.

Greetz to anyone who can hook me up with a solution.

.


Loading