Re: List all the files of specific extention on remote Cluster Nod

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

When "*" is used in:
"Select * from CIM_DataFile where Extension = 'mp3'"

....it means return all properties of each file. You could reducing the
resource load of the query by only requesting the attributes/properties that
you really need, e.g.:
"Select Drive,Extension,FileName,FileSize,Path from CIM_DataFile
where Extension = 'mp3'"

....i.e. selecting only five of the many attributes available, as listed
here:
http://msdn2.microsoft.com/en-us/library/aa387236.aspx

You could reducing it even more to just FileSize and Path.

Regards,
Dave.



"AKDN" <AKDN@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:46DFED41-4587-4934-A8CB-F2092C33F0E3@xxxxxxxxxxxxxxxx
Hello,

Thanks for your help. But it gave me the same results. I think the volume
is
so big as it is about 3 TB and I believe that on this 3 TB I have max 500
MP3
files. Do you have any other idea ??



"D.R." wrote:

Hi AKDN,

Try adding these options to the end of your ExecQuery:
,"WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)

...so that you have:
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_DataFile Where Extension = 'mp3'", _
"WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)


....and you'll also need two constants:
Const wbemFlagReturnImmediately = &H10
Const wbemFlagForwardOnly = &H20


N.B. You won't be able to use the ".count" property. You'll have to do
your
own count incrementer.


Search the web for a description of why the above might work for you.

Regards,
Dave.



"AKDN" <AKDN@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8EE9C434-675F-4A68-B8AB-40FA0A592622@xxxxxxxxxxxxxxxx
Hi,

I have problem to run vbscript to list all the files of specific
extention
on remote Cluster Node. I have about 20 cluser servers around the world
I
want to find all the MP3 files on my servers. I am able to get result
on
some
servers but not on all. I get no error but my code list no file but I
see
many file on the server.

I am useing this code

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")

Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_DataFile Where Extension = 'mp3'")

If colFiles.Count = 0 Then
Wscript.Quit
End If

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("C:\Scripts\mp3.txt")

For Each objFile in colFiles
objTextFile.Write(objFile.Drive & objFile.Path & ",")
objTextFile.Write(objFile.FileName & "." & objFile.Extension & ",")
objTextFile.Write(objFile.FileSize & vbCrLf)
Next

objTextFile.Close


If some one have a vb.net code to search files on remote server (may be
cluster) then please share with me.

Thanks for any help.








.



Relevant Pages

  • Re: List all the files of specific extention on remote Cluster Node
    ... Set colFiles = objWMIService.ExecQuery _ ... on remote Cluster Node. ... I have about 20 cluser servers around the world I ... If some one have a vb.net code to search files on remote server (may be ...
    (microsoft.public.windows.server.scripting)
  • Re: List all the files of specific extention on remote Cluster Nod
    ... Set colFiles = objWMIService.ExecQuery _ ... on remote Cluster Node. ... I have about 20 cluser servers around the world I ... If some one have a vb.net code to search files on remote server (may be ...
    (microsoft.public.windows.server.scripting)
  • Re: Poor PostgreSQL scaling on Linux 2.6.25-rc5 (vs 2.6.22)
    ... By definition, if they are not CPU bound, then they should be run ... And the efficiency we're talking about reducing here is due to the ... tune servers ...
    (Linux-Kernel)
  • NTFRS File size problem
    ... I have a WIN2K-AS SP4 running as a DC and has a NTFRS.JDB ... file that is 1.2GB The rest of the servers have a 2MB ... But the link did not provide any information on reducing ... Conrad ...
    (microsoft.public.win2000.general)