Win32_Directory class
The Win32_Directory WMI class represents a directory entry on a computer system running Windows. A directory is a type of file that logically groups data files and provides path information for the grouped files. Example: C:\TEMP. Win32_Directory does not include directories of network drives.
The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties are listed in alphabetic order, not MOF order.
Syntax
class Win32_Directory : CIM_Directory
{
uint32 AccessMask;
boolean Archive;
string Caption;
boolean Compressed;
string CompressionMethod;
string CreationClassName;
datetime CreationDate;
string CSCreationClassName;
string CSName;
string Description;
string Drive;
string EightDotThreeFileName;
boolean Encrypted;
string EncryptionMethod;
string Extension;
string FileName;
uint64 FileSize;
string FileType;
string FSCreationClassName;
string FSName;
boolean Hidden;
datetime InstallDate;
uint64 InUseCount;
datetime LastAccessed;
datetime LastModified;
string Name;
string Path;
boolean Readable;
string Status;
boolean System;
boolean Writeable;
};
Members
The Win32_Directory class has these types of members:
Methods
The Win32_Directory class has these methods.
| Method | Description |
|---|---|
| ChangeSecurityPermissions |
Class method that changes the security permissions for the logical file specified in the object path. |
| ChangeSecurityPermissionsEx |
Class method that changes the security permissions for the logical file specified in the object path. |
| Compress |
Class method that compresses the logical file (or directory) specified in the object path. |
| CompressEx |
Class method that compresses the logical file (or directory) specified in the object path. |
| Copy |
Class method that copies the logical file or directory specified in the object path to the location specified by the input parameter. |
| CopyEx |
Class method that copies the logical file or directory specified in the object path to the location specified by the FileName parameter. |
| Delete |
Class method that deletes the logical file (or directory) specified in the object path. |
| DeleteEx |
Class method that deletes the logical file (or directory) specified in the object path. |
| GetEffectivePermission |
Class method that determines whether the caller has the aggregated permissions specified by the Permissions argument not only on the file object, but on the share the file or directory resides on (if it is on a share). |
| Rename |
Class method that renames the logical file (or directory) specified in the object path. |
| TakeOwnerShip |
Class method that obtains ownership of the logical file specified in the object path. |
| TakeOwnerShipEx |
Class method that obtains ownership of the logical file specified in the object path. |
| Uncompress |
Class method that uncompresses the logical file (or directory) specified in the object path. |
| UncompressEx |
Class method that uncompresses the logical file (or directory) specified in the object path. |
Properties
The Win32_Directory class has these properties.
- AccessMask
-
- Data type: uint32
- Access type: Read-only
Bitmask that represents the access rights required to access or perform specific operations on the directory. For bit values, see File and Directory Access Rights Constants.
Windows 2000 and Windows NT 4.0: On FAT volumes, the FULL_ACCESS value is returned instead, which indicates no security has been set on the object. - Archive
-
- Data type: boolean
- Access type: Read-only
If True, the file should be archived.
- Caption
-
- Data type: string
- Access type: Read-only
Short description of the object. This property is inherited from CIM_ManagedSystemElement.
- Compressed
-
- Data type: boolean
- Access type: Read-only
If True, the file is compressed.
- CompressionMethod
-
- Data type: string
- Access type: Read-only
Algorithm or tool used to compress the logical file. If it is not possible (or not desired) to describe the compression scheme (perhaps because it is not known), use the following words: "Unknown" to represent that it is not known whether the logical file is compressed; "Compressed" to represent that the file is compressed, but either its compression scheme is not known or not disclosed; and "Not Compressed" to represent that the logical file is not compressed.
- CreationClassName
-
- Data type: string
- Access type: Read-only
Name of the first concrete class to appear in the inheritance chain used in the creation of an instance. When used with the other key properties of the class, this property allows all instances of this class and its subclasses to be uniquely identified.
- CreationDate
-
- Data type: datetime
- Access type: Read-only
File creation date.
- CSCreationClassName
-
- Data type: string
- Access type: Read-only
Creation class name of the scoping computer system.
- CSName
-
- Data type: string
- Access type: Read-only
Name of the scoping computer system.
- Description
-
- Data type: string
- Access type: Read-only
Description of the object. This property is inherited from CIM_ManagedSystemElement.
- Drive
-
- Data type: string
- Access type: Read-only
Drive letter (including colon) of the file.
Example: "c:"
- EightDotThreeFileName
-
- Data type: string
- Access type: Read-only
DOS-compatible file name for this file.
Example: "c:\progra~1"
- Encrypted
-
- Data type: boolean
- Access type: Read-only
If True, the file is encrypted.
- EncryptionMethod
-
- Data type: string
- Access type: Read-only
Algorithm or tool used to encrypt the logical file. If it is not possible (or not desired) to describe the encryption scheme (perhaps for security reasons), use the following words: "Unknown" to represent that it is not known whether the logical file is encrypted; "Encrypted" to represent that the file is encrypted, but either its encryption scheme is not known or not disclosed; and "Not Encrypted" to represent that the logical file is not encrypted.
- Extension
-
- Data type: string
- Access type: Read-only
File name extension (without the dot). Examples: "txt", "mof", "mdb"
- FileName
-
- Data type: string
- Access type: Read-only
File name (without the dot or extension) of the file.
Example: "autoexec"
- FileSize
-
- Data type: uint64
- Access type: Read-only
Size of the file (in bytes).
For more information about using uint64 values in scripts, see Scripting in WMI.
- FileType
-
- Data type: string
- Access type: Read-only
File type (indicated by the Extension property).
- FSCreationClassName
-
- Data type: string
- Access type: Read-only
Class of the file system.
- FSName
-
- Data type: string
- Access type: Read-only
Name of the file system.
- Hidden
-
- Data type: boolean
- Access type: Read-only
If True, the file is hidden.
- InstallDate
-
- Data type: datetime
- Access type: Read-only
The date the object was installed. This property does not require a value to indicate that the object is installed. This property is inherited from CIM_ManagedSystemElement.
- InUseCount
-
- Data type: uint64
- Access type: Read-only
Number of "file opens" that are currently active against the file.
For more information about using uint64 values in scripts, see Scripting in WMI.
- LastAccessed
-
- Data type: datetime
- Access type: Read-only
Date the file was last accessed.
- LastModified
-
- Data type: datetime
- Access type: Read-only
Date the file was last modified.
- Name
-
- Data type: string
- Access type: Read-only
Inherited name that serves as a key of a logical file instance within a file system. Full path names should be provided. This property is inherited from CIM_ManagedSystemElement.
Example: "c:\winnt\system\win.ini"
- Path
-
- Data type: string
- Access type: Read-only
Path of the file. This includes leading and trailing backslashes.
Example: "\windows\system\"
- Readable
-
- Data type: boolean
- Access type: Read-only
If True, the file can be read.
- Status
-
- Data type: string
- Access type: Read-only
- Qualifiers: MaxLen (10)
Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither "OK" nor in one of the other states. This property is inherited from CIM_ManagedSystemElement.
The values are:
- "OK"
- "Error"
- "Degraded"
- "Unknown"
- "Pred Fail"
- "Starting"
- "Stopping"
- "Service"
- "Stressed"
- "NonRecover"
- "No Contact"
- "Lost Comm"
- System
-
- Data type: boolean
- Access type: Read-only
If True, the file is a system file.
- Writeable
-
- Data type: boolean
- Access type: Read-only
If True, the file can be written.
Remarks
The Win32_Directory class is derived from CIM_Directory.
Examples
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For C++ code examples, see WMI C++ Application Examples.
Requirements
|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Namespace |
\root\CIMV2 |
|
MOF |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 11/19/2012
