Search DaTutorials:  
HOME
VB Script Tutorials
Introduction
Reference
Tutorials

GetExtensionName Method

Returns a string containing the extension name for the last component in a path.

object.GetExtensionName(path)

Arguments

object

Required. Always the name of a FileSystemObject.

path

Required. The path specification for the component whose extension name is to be returned.

Remarks

For network drives, the root directory (\) is considered to be a component.

The GetExtensionName method returns a zero-length string ("") if no component matches the path argument.

The following example illustrates use of the GetExtensionName method:

Function GetAnExtension(DriveSpec)
   Dim fso
   Set fso = CreateObject("Scripting.FileSystemObject")
   GetAnExtension = fso.GetExtensionName(Drivespec)
End Function

See Also

GetAbsolutePathName Method | GetBaseName Method | GetDrive Method | GetDriveName Method | GetFile Method | GetFileName Method | GetFolder Method | GetParentFolderName Method | GetSpecialFolder Method | GetTempName Method

Applies To: FileSystemObject Object


     Personal Injury Lawyer Los Angeles | Loan | Internet Advertising | Credit Report | Loans
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp