File.ShortName

JScript3.0+Syntax

							file.ShortName

Description

The ShortName property returns the short name used by programs that require the earlier 8.3 naming convention.

Example

Listing 9.62 shows how to access the short name of the file.

Listing 9.62 Example of the ShortName Property
<html>
<body>

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

// function gets the shortname for the file.
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 ShortName is: " + f.ShortName);
}

//-->
</script>

<form name="myForm">
<input type="Button" value="Get Shortname" 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.