FileSystemObject.GetFileName()

JScript3.0+Syntax

							filesystemobject.GetFileName(filename)

Description

The GetFileName() method is used to get a specified filename. This method takes filename as its only parameter, which represents the absolute or relative path to the file.

Example

Listing 9.87 shows how the GetFileName() property is used.

Listing 9.87 Example of GetFileName()
<html>
<body>

<script language="JScript">
<!-- Hide

function getname()
{
  var myObject, name;  // Creates an instance of the FileSystemObject
  myObject = new ActiveXObject("Scripting.FileSystemObject");

  // Gets the file name
  name = myObject.GetFileName("c:\\test.txt"); // Informs the user of the name alert("The file name is:" + name); } // End Hide --> </script> Get the ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.