How to Retrieve Hidden/System Files Using Dir[$]() FunctionLast reviewed: June 21, 1995Article ID: Q104685 |
The information in this article applies to:
- Microsoft Visual Basic programming system for Windows, versions 2.0 and 3.0
SUMMARYThis article shows by example how to use the Dir[$]() function in conjunction with the GetAttr() function to retrieve read-only, hidden, or system files.
MORE INFORMATIONThe Dir[$] functions take a filespec and an attrmask as optional arguments. If the attrmask argument specifies the volume label, the Dir[$] functions ignores all other attributes. If the attrmask argument is ATTR_HIDDEN, ATTR_SYSTEM, or ATTR_DIRECTORY, the functions also return the files that do not have any special attributes. If the filespec argument is used, the functions return files that do not have any hidden, system, or directory attributes and meet the filespec requirements. To retrieve only read-only, hidden, or system files, use the Dir[$]() functions in conjunction with the GetAttr() function. The following shows by example how to retrieve only hidden files (files that have the HIDDEN or ATTR_HIDDEN+ATTR_ARCHIVE attributes) by using the Dir() function in conjunction with the GetAttr() function.
Step-by-Step Example
|
Additional reference words: 2.00 3.00 Dir Dir$ GetAttr docerr
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |