- WMI Library -
WMI Libraly > CIM_DataFile Class

CIM_DataFile Class

CIM_DataFile is a type of logical file that is a named collection of data or executable code.
The behavior of the provider backing this class will be changed in future releases. Currently the provider returns both files on fixed disks as well as files on mapped logical disks. In the future, only instances of files on local fixed disks will be returned.
Namespace value is root/CIMV2.
WMI Provider value is CIMWin32.


Properties

  • AccessMask
  • The AccessMask property is a bit array representing the access rights to the given file or directory held by the user or group on whose behalf the instance is returned. This property is only supported under Windows NT and Windows 2000. On Windows 98 and on Windows NT/2000 FAT volumes, FULL_ACCESS is returned, indicating no security has been set on the object.

  • Archive
  • The Archive property is a boolean value indicating that the file should be archived.

  • Caption
  • The Caption property is a short textual description (one-line string) of the object.

  • Compressed
  • The Compressed property is a boolean value indicating that the file is compressed.

  • CompressionMethod
  • The CompressionMethod property is a free form string indicating the 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 or not, "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
  • The CreationClassName property is a string indicating the name of this class.

  • CreationDate
  • The CreationDate property is a datetime value indicating the file's creation date.

  • CSCreationClassName
  • The CSCreationClassName property is a string indicating the class of the computer system.

  • CSName
  • The CSName property is a string indicating the name of the computer system.

  • Description
  • The Description property provides a textual description of the object.

  • Drive
  • The Drive property is a string representing the drive letter (including colon) of the file. Example: c:

  • EightDotThreeFileName
  • The EightDotThreeFileName property is a string representing the DOS-compatible file name for this file.
    Example: c:\progra~1

  • Encrypted
  • The Encrypted property is a boolean value indicating that the file is encrypted.

  • EncryptionMethod
  • The EncryptionMethod property is a free form string indicating the 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 or not, "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
  • The Extension property is a string representing the file's extension (without the dot). Example: txt, mof, mdb.

  • FileName
  • The FileName property is a string representing the filename (without extension) of the file. Example: autoexec

  • FileSize
  • The FileSize property represents the size of the file (in bytes).

  • FileType
  • The FileType property is a string descriptor representing the file type (indicated by the Extension property).

  • FSCreationClassName
  • The FSCreationClassName property is a string indicating the class of the file system.

  • FSName
  • The FSName property is string indicating the name of the file system.

  • Hidden
  • The Hidden property is a boolean value indicating if the file is hidden.

  • InstallDate
  • The InstallDate property is datetime value indicating when the object was installed. A lack of a value does not indicate that the object is not installed.

  • InUseCount
  • The InUseCount property is an integer indicating the number of 'file opens' that are currently active against the file.

  • LastAccessed
  • The LastAccessed property is a datetime value indicating the time the file was last accessed.

  • LastModified
  • The LastModified property is a datetime value indicating the time the file was last modified.

  • Manufacturer
  • Manufacturer string from version resource if one is present.

  • Name
  • The Name property is a string representing the inherited name that serves as a key of a logical file instance within a file system. Full path names should be provided. Example: c:\winnt\system\win.ini

  • Path
  • The Path property is a string representing the path of the file. This includes leading and trailing backslashes. Example: \windows\system\

  • Readable
  • The Readable property is a boolean value indicating if the file can be read.

  • Status
  • The Status property is a string indicating the current status of the object. Various operational and non-operational statuses can be defined. Operational statuses are "OK", "Degraded" and "Pred Fail". "Pred Fail" indicates that an element may be functioning properly but predicting a failure in the near future. An example is a SMART-enabled hard drive. Non-operational statuses can also be specified. These are "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 on-line, yet the managed element is neither "OK" nor in one of the other states.

  • System
  • The system property is a boolean value indicating if the file is a system file.

  • Version
  • Version string from version resource if one is present.

  • Writeable
  • The Writeable property is a boolean value indicating if the file can be written.


    Methods

  • TakeOwnerShip
  • The TakeOwnerShip method obtains ownership of the logical file specified in the object path . If the logical file is actually a directory, then TakeOwnerShip will act recursively, taking ownership of all the files and sub-directories the directory contains.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • ChangeSecurityPermissions
  • The ChangeSecurityPermissions method changes the security permissions for the logical file specified in the object path. If the logical file is actually a directory, then ChangeSecurityPermissions will act recursively, changing the security permissions of all the files and sub-directories the directory contains. ChangeSecurityPermissions returns an integer value of 0 if the permissions were changed, and any other number to indicate an error.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • Copy
  • The Copy method copies the logical file or directory specified in the object path to the location specified by the input parameter. Copy returns an integer value of 0 if the file was successfully copied, and any other number to indicate an error. A copy is not supported if overwriting an existing logical file is required.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • Rename
  • The Rename method renames the logical file (or directory) specified in the object path. Rename returns an integer value of 0 if the file was successfully renamed, and any other number to indicate an error. A rename is not supported if the destination is on another drive or overwriting an existing logical file is required
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • Delete
  • The Delete method will delete the logical file (or directory) specified in the object path. Delete returns an integer value of 0 if the file was successfully deleted, and any other number to indicate an error.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • Compress
  • The Compress method compresses the logical file (or directory) specified in the object path. Compress returns an integer value of 0 if the file was successfully compressed, and any other number to indicate an error.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • Uncompress
  • The Uncompress method uncompresses the logical file (or directory) specified in the object path. Uncompress returns an integer value of 0 if the file was successfully decompressed, and any other number to indicate an error.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • TakeOwnerShipEx
  • The TakeOwnerShipEx method obtains ownership of the logical file specified in the object path. If the logical file is actually a directory, then this method will act recursively, taking ownership of all the files and sub-directories the directory contains. TakeOwnerShipEx returns an integer value of 0 on success, and any other number to indicate an error. TakeOwnerShipEx is an extended version of the TakeOwnerShip method.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • ChangeSecurityPermissionsEx
  • The ChangeSecurityPermissionsEx method changes the security permissions for the logical file specified in the object path. If the logical file is actually a directory, then this method will act recursively, changing the security permissions of all the files and sub-directories the directory contains. ChangeSecurityPermissionsEx returns an integer value of 0 if the permissions were changed, and any other number to indicate an error. The ChangeSecurityPermissionsEx method is an extended version of the ChangeSecurityPermissions method.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • CopyEx
  • The CopyEx method copies the logical file or directory specified in the object path to the location specified by the FileName parameter. CopyEx returns an integer value of 0 if the file was successfully copied, and any other number to indicate an error. A copy is not supported if overwriting an existing logical file is required. CopyEx is an extended version of the Copy method.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • DeleteEx
  • The DeleteEx method will delete the logical file (or directory) specified in the object path. DeleteEx returns an integer value of 0 if the file was successfully deleted, and any other number to indicate an error. DeleteEx is an extended version of the Delete method.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • CompressEx
  • The CompressEx method compresses the logical file (or directory) specified in the object path. CompressEx returns an integer value of 0 if the file was successfully compressed, and any other number to indicate an error. CompressEx is an extended version of the Compress method.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • UncompressEx
  • The UncompressEx method uncompresses the logical file (or directory) specified in the object path. UncompressEx returns an integer value of 0 if the file was successfully decompressed, and any other number to indicate an error. UncompressEx is an extended version of the Uncompress method.
    It returns one of the following integer values:
    0 - The request was successful.
    2 - Access was denied.
    8 - An unspecified failure occurred.
    9 - The name specified was invalid.
    10 - The object specified already exists.
    11 - The file system is not NTFS.
    12 - The platform is not Windows NT or Windows 2000.
    13 - The drive is not the same.
    14 - The directory is not empty.
    15 - There has been a sharing violation.
    16 - The start file specified was invalid.
    17 - A privilege required for the operation is not held.
    21 - A parameter specified is invalid.


  • GetEffectivePermission
  • The GetEffectivePermission method determines whether the caller has the aggregated permissions specified by the Permission argument not only on the file object, but on the share the file or directory resides on (if it is on a share).


    Example WQL

    SELECT * FROM CIM_DataFile
    About this site information

    This contents is created by WMI having class information.
    WMI Environment is Windows Server 2008 R2 Enterprise Edition.

    This link is Microsoft documents for "Managing Windows with WMI".
    That is VB(Visual Basic) scripting sample.
    This link is Microsoft documents for "Advanced Programming Topics in WMI .NET".
    That is VB.net(Visual Basic .net) scripting sample.

    - WMI Library -
    http://library.wmifun.net/

    WMI useful by VB,VB.Net,VC,VC.Net,VC#.Net,VBS(WSH),PowerShell for PC asset management, system monitoring and collecting hardware and software inventory.

    This website is created by Toh.
    Copyright(C) 1997-2016 WMI Fun !!. All rights reserved.
    ^ Go to the top...