VBScript » FileSystemObject » GetBaseName

Version: 2.0

Syntax:
object.GetBaseName(path)

This method gets the base name of the file or folder in a specified path.

The returned string contains only the base name of the file, without any extension.

Note that this method doesn't check the existance or the validity of the supplied path.

Examples

Code:
<%
dim filesys, a
Set filesys = CreateObject("Scripting.FileSystemObject")
filesys.CreateTextFile "c:\DevGuru\website\VBScript.txt", True
a = filesys.GetBaseName("c:\DevGuru\website\VBScript.txt")
Response.Write (a)
%>
Output:
"VBScript"