Forum Discussion

MAK89's avatar
MAK89
Occasional Contributor
9 years ago
Solved

How to open desired folder hierarchy from local system without using name mapping ?

How to open desired folder hierarchy from local system without using name mapping ?

  • MAK89's avatar
    MAK89
    9 years ago

    NisHera

    It is partially working , it open just my document folder but not complete path.

    I use the follwing code

    Sys.OleObject("WScript.Shell").Run("explorer C:\Users\manas\Documents\TestComplete 11 Projects\ProjectSuite1"); 

    but it open document folder instead of ProjectSuite1.

  • Hi,

     

    I believe this is because the path contains a space.

    Try something like this (note quotes around the path):

    Sys.OleObject("WScript.Shell").Run("explorer ""C:\Users\manas\Documents\TestComplete 11 Projects\ProjectSuite1"""); 

7 Replies

  • djadhav's avatar
    djadhav
    Regular Contributor

    VBScript Example:

     

    FUNCTION OpenExplorer(ByVal fldrPath)
        DIM wsh : SET wsh = CreateObject("WScript.shell")
        DIM the_ConsoleCmd : the_ConsoleCmd = "cmd /k " & " explorer " & fldrPath & " &" & " exit"
        r = wsh.run(the_ConsoleCmd)
    End FUNCTION
    
    SUB tst2
        CALL OpenExplorer("c:\TC11Projects")
    END SUB 
    • MAK89's avatar
      MAK89
      Occasional Contributor

      NisHera

      It is partially working , it open just my document folder but not complete path.

      I use the follwing code

      Sys.OleObject("WScript.Shell").Run("explorer C:\Users\manas\Documents\TestComplete 11 Projects\ProjectSuite1"); 

      but it open document folder instead of ProjectSuite1.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        I believe this is because the path contains a space.

        Try something like this (note quotes around the path):

        Sys.OleObject("WScript.Shell").Run("explorer ""C:\Users\manas\Documents\TestComplete 11 Projects\ProjectSuite1""");