File.ShortPath

JScript3.0+Syntax

							file.ShortPath

Description

The ShortPath property returns the short path used by programs that require the earlier 8.3 naming convention.

Example

Listing 9.63 shows how to get the short path for the specified file.

Listing 9.63 Example of ShortPath
<html>
<BODY>

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

// function gets the shortpath of the file object.
function get()
{
  var myObject, f;
  // Create an instance of the FileSystemObject
  myObject = new ActiveXObject("Scripting.FileSystemObject");
  f = myObject.GetFile("c:\\tmp\\myTest.txt");
  alert("The file ShortPath name is: " + f.ShortPath);
}

//-->
</script>

<form name="myForm">
<INPUT type="Button" value="Get Shortpath" onClick='get()'>
</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.