Is Vbscript the best way to get directory listings? How the speed of VBScript to copy files and to get directory listings compare with commercial products?
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
[1]
>WMI is way fast but more difficult to code if you are unfamiliar with WMI.
[1.1] quote documentation
[tt]CIM_DataFile is one of the few CIM classes in WMI that is implemented. Avoid enumerating or querying for all instances of CIM_DataFile on a computer because the volume of data is likely to either affect performance or cause the computer to stop responding.[/tt]
[1.2] Even you're skilled in querying cimv2_datafile and know using associator query, it is not at all sure it is faster than internal command "dir" written in whatever assembly or c.
[1.3] wmi query offers better selective query that dir cannot handle, sure; but wmi is a heavy weapon, it is not heavy without a reason and it is praised as a state-or-the-art tool despite its being heavy without a reason.
[2]
>But that will not scale.
I've never heard wmi service pooled neither. So scale in what sense? Difference users using the same wmi service?
[3]
> Using WMI you will be able to query remote systems.
It does not imply dir not being unable to query remote system, maybe just not as versatile. Does "share" exist no more?
[4] In any case, we don't compare elephant with mouse in simplist term.
I'm often amazed at the crazy things people will do with WMI.
It's a very heavy service, and one that may not be installed or even running on a given system. Its purpose is rarely-running administrative chores. One should never use it as part of an application, or even a script that users might run frequently.
There are many things that aren't otherwise exposed to script out of the box though. WMI has very broad reach.
Sadly, [tt]Dir[/tt] was not implemented in VBScript. Instead you have the FileSystemObject and speedwise it just doesn't cut the mustard. One alternative might be to write your "directory lister" in VB6... but even then unless you use API calls you'll stumble over Unicode pathnames.
There are also alternative script hosts for VBScript that offer a little more power. One I use is NSBasic Desktop. In addition to things like GUI forms it adds a standard library for binding API calls to VBScript (and a bunch of other nice goodies, like a decent IDE).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.