Win32_ShortcutFile class
The Win32_ShortcutFile WMI 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
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.
| 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 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. This property is only supported under Windows NT and Windows 2000. On Windows 98 and on Windows NT and Windows 2000 FAT volumes, the FULL_ACCESS value is returned instead, indicating that 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.
- 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 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