FileSystemObject.GetParentFolderName()

JScript3.0+Syntax

							filesystemobject.GetParentFolderName(foldername)

Description

The GetParentFolderName() method is used to get the name of the parent folder for a specified file or folder. This method takes foldername as its only parameter, which represents the path for the name of the subfolder.

Example

Listing 9.89 shows how to get the name for the parent folder.

Listing 9.89 Example of GetParentFolderName()
 <html> <body> <script language="JScript"> <!-- Hide function getparent() { var myObject, name; // Creates an instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); name = myObject.GetParentFolderName("c:\\tmp\\subfolder"); alert("The parent folder name ...

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.