Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

FileSystemObject : GetParentFolderName Method

Description: 

Returns the par­ent folder name.

Format : 

objectOf­FileSys­te­mOb­ject. GetParentFolderName(filepath)

  • objectOf­FileSys­te­mOb­ject : As the name says, it’s a FileSystemObject.
Arguments: 
  • filepath
    • Manda­tory
    • Type:     String
    • File path for which Par­ent Folder is to be return.

Function FnGetParentFolderName (strSpecificFilePath)

    Set fso = CreateObject("Scripting.FileSystemObject")

    strParentFolderName = fso. GetParentFolderName(strSpecificFilePath)    FnGetParentFolderName = strParentFolderName

End Function

Msg­box  FnGet­Par­ent­Fold­er­Name (“c:\New Folder\file.txt”)

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: