Syntax
filesystemobject.GetParentFolderName(foldername)
The GetParentFolderName() method gets the name of the parent folder.
This method takes foldername as its only parameter.
<html> <body> <script language="JScript"> <!-- function getparent() { var myObject, name; myObject = new ActiveXObject("Scripting.FileSystemObject"); name = myObject.GetParentFolderName("c:\\tmp\\subfolder"); alert("The parent folder name is:" + name); } --> </script> Get the parent folder name for "subtmp" folder. <form name="myForm"> <input type="Button" value="Get Parent Folder" onClick='getparent()'> </form> </body> </html>