File.Path

JScript3.0+Syntax

							file.Path

Description

The Path property is used to get the path for a specified file.

Example

Listing 9.61 shows an example of the Path property.

Listing 9.61 Example of the Path Property
<html>
<body>

<script language="JScript">
<!-- Hide
function getPath()
{
  var myObject, f;
  // Create an instance of the FileSystemObject
  myObject = new ActiveXObject("Scripting.FileSystemObject");
  f = myObject.GetFile("c:\\tmp\\myTest.txt");
  alert("The name of the path is: " + f.Path);
}

//-->
</script>

<form name="myForm">
<input type="Button" value="Get Path" onClick='getPath()'>
</form>
</body>
</html>
						

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.