Forum Discussion

evertonalmeida's avatar
evertonalmeida
Occasional Contributor
7 years ago

How do I return a directory?

Good Morning,

How do I return a directory?

 

Ex: my ProjectSuite is in: X: \ GRV \ CPS5 \ Projects \ TestComplete \ Registrations \

 

I would like to get the string: X: \ GRV \ CPS5 \ Projects \ TestComplete \

 

Thank you

4 Replies

  • sanjay0288's avatar
    sanjay0288
    Frequent Contributor

    Which scripting language are you using? A sample vbscript snippet is provided below. Which might be of some help

     

    Sub GetParentFolder
        suitePath = projectsuite.Path
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFldr = objFSO.GetFolder(suitePath)
        MsgBox objFldr
        strFolder = objFSO.GetParentFolderName(objFldr)  
        MsgBox strFolder
    End Sub

  • shankar_r's avatar
    shankar_r
    Community Hero

    Project.Path will return project path

    ProjectSuite.Path will return project suite path

    • evertonalmeida's avatar
      evertonalmeida
      Occasional Contributor

      Sim, mas preciso retornar um diretório antes do ProjectSuite

      • shankar_r's avatar
        shankar_r
        Community Hero

        I don't think you will get that path by default, need to do some scripting do the same.

         

        Please type here English otherwise we need to understand like below :)