FileSystemObject.GetParentFolderName() : FileSystemObject : MS JScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » MS JScript » FileSystemObject »

 

FileSystemObject.GetParentFolderName()










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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo MS JScript
» FileSystemObject