Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
One of the advantages of using WMI as a file management tool is the fact that WMI allows you to locate all the files that meet a specified set of criteria, regardless of the physical location of those files. For example, you can return a collection of all the files consisting of a particular file name extension, all the read-only files, or all the files created on a specified date. After these files are enumerated, you can carry out various operations on the entire collection, including copying, deleting, or renaming each of the files.
Tip
Listing 11.22 contains a script that returns a set of all the files with a file size larger than 1,000,000 bytes. To carry out this task, the script must perform the following steps:
To limit data retrieval to a specific set of files, a Where clause is included restricting the returned files to those with a size of 1,000,000 bytes or more.
Listing 11.22 Enumerating a Specific Set of Files
|
|
Send us your feedback | « Previous | Next » |