GETSHORTPATH Method (FileSystem)
Description
Converts a "normal" long path to a legacy short DOS-style short "8.3" path.
Syntax
ShortPath = Exec_Method( "FILESYSTEM", "GETSHORTPATH", LongPath )
Parameters
Name | Required | Description |
---|---|---|
LongPath | Yes | Specifies the long path to convert. |
Returns
The converted short path if successful, or null if the method fails. The FILEOPRESULT property may be used to obtain more details regarding the failure.
Remarks
The GETSHORTPATH method is basically a wrapper around the GetShortPath Windows API function, so it is worth examining at the documentation for this on the MSDN website to get a better idea of the capabilities of this method.
Example
// Use GETSHORTPATH to convert a long path LongPath = "C:\Program Files\my_app" ShortPath = Exec_Method( "FILESYSTEM", "GETSHORTPATH", LongPath ) If BLen( ShortPath ) Then // ShortPath should be: "C:\ Progra~1\my_app" End Else ErrorInfo = Get_Property( "FILESYSTEM", "FILEOPRESULT" ) ErrorCode = ErrorInfo<PS_FOR_ERRORCODE$> ErrorText = ErrorInfo<PS_FOR_ERRORTEXT$> End
See Also
GETLONGPATH method, FILEOPRESULT property.