From http://www.w3schools.com (Copyright Refsnes Data)
Complete FileSystemObject Object Reference
The GetFileName method returns a string that contains the file name or folder name for the last component in a specified path.
| FileSystemObject.GetFileName(path) |
| Parameter | Description |
|---|---|
| path | Required. The path to a specific file or folder |
Get a filename:
|
<% dim fs,p set fs=Server.CreateObject("Scripting.FileSystemObject") p=fs.getfilename("c:\test\test.htm") response.write(p) set fs=nothing %> Output: test.htm |
Get a foldername:
|
<% dim fs,p set fs=Server.CreateObject("Scripting.FileSystemObject") p=fs.getfilename("c:\test\") response.write(p) set fs=nothing %> Output: test |
Complete FileSystemObject Object Reference
From http://www.w3schools.com (Copyright Refsnes Data)