Export (0) Print
Expand All

Win32_ShortcutFile class

The Win32_ShortcutFileWMI class represents files that are shortcuts to other files, directories, and commands.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

[Provider("CIMWin32")]class Win32_ShortcutFile : CIM_DataFile
{
  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   Manufacturer;
  string   Name;
  string   Path;
  boolean  Readable;
  string   Status;
  boolean  System;
  string   Target;
  string   Version;
  boolean  Writeable;
};

Members

The Win32_ShortcutFile class has these types of members:

Methods

The Win32_ShortcutFile class has these methods.

MethodDescription
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 Permission 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_ShortcutFile class has these properties.

AccessMask
Data type: uint32 array
Access type: Read-only

List of access rights to the given file or directory held by the user or group on whose behalf the instance is returned.. On FAT volumes, the FULL_ACCESS value is returned instead, indicating that no security has been set on the object.

ValueMeaning
FILE_READ_DATA (file) FILE_LIST_DIRECTORY (directory)
0 (0x0)

Grants the right to read data from the file. For a directory, this value grants the right to list the contents of the directory.

FILE_WRITE_DATA (file) FILE_ADD_FILE (directory)
1 (0x1)

Grants the right to write data to the file. For a directory, this value grants the right to create a file in the directory.

FILE_APPEND_DATA (file) FILE_ADD_SUBDIRECTORY
4 (0x4)

Grants the right to append data to the file. For a directory, this value grants the right to create a subdirectory.

FILE_READ_EA
8 (0x8)

Grants the right to read extended attributes.

FILE_WRITE_EA
16 (0x10)

Grants the right to write extended attributes.

FILE_EXECUTE (file) FILE_TRAVERSE (directory)
32 (0x20)

Grants the right to execute a file. For a directory, the directory can be traversed.

FILE_DELETE_CHILD
64 (0x40)

Grants the right to delete a directory and all of the files it contains (its children), even if the files are read-only.

FILE_READ_ATTRIBUTES
128 (0x80)

Grants the right to read file attributes.

FILE_WRITE_ATTRIBUTES
256 (0x100)

Grants the right to change file attributes.

DELETE
65536 (0x10000)

Grants delete access.

READ_CONTROL
131072 (0x20000)

Grants read access to the security descriptor and owner.

WRITE_DAC
262144 (0x40000)

Grants write access to the discretionary access control list (DACL).

WRITE_OWNER
524288 (0x80000)

Assigns the write owner.

SYNCHRONIZE
1048576 (0x100000)

Synchronizes access and allows a process to wait for an object to enter the signaled state.

 

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.

Compressed
Data type: boolean
Access type: Read-only

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 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
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

Class of the computer system.

CSName
Data type: string
Access type: Read-only

Name of the computer system.

Description
Data type: string
Access type: Read-only

Description of the object.

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

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 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
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

Name (without 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

File is hidden.

InstallDate
Data type: datetime
Access type: Read-only

Object was installed. This property does not need a value to indicate that the object is installed.

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

File was last accessed.

LastModified
Data type: datetime
Access type: Read-only

File was last modified.

Manufacturer
Data type: string
Access type: Read-only

Manufacturer name from version resource, if one is present.

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.

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

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.

The values are:

"OK"
"Error"
"Degraded"
"Unknown"
"Pred Fail"
"Starting"
"Stopping"
"Service"
"Stressed"
"Nonrecover"
"NoContact"
"LostComm"
System
Data type: boolean
Access type: Read-only

File is a system file.

Target
Data type: string
Access type: Read-only

Name of the object that this is a shortcut to.

Version
Data type: string
Access type: Read-only

Version name from the version resource, if one is present.

Writeable
Data type: boolean
Access type: Read-only

File can be written.

Remarks

The Win32_ShortcutFile class is derived from CIM_DataFile.

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 XP

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

CIMWin32.dll

See also

Operating System Classes

 

 

Show:
© 2014 Microsoft