Open containing directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CrispinH
    Journeyman
    • Jun 2005
    • 19

    Open containing directory

    It would be handy to have a context menu (aka right-click) option to open the containing directory of a file. Some file comparisons (eg Word documents) are best done with the appropriate application rather than binary compares.

    Crispin
  • Ernie
    Fanatic
    • Mar 2004
    • 137

    #2
    Re: Open containing directory

    Simply add an entry to your "Open With Applications" (Tools -> Options -> Open With).

    Click New and enter Explorer for the description and enter explorer.exe "%p" for the command line. Check out the online help for more information on setting up "open with" applications.

    Next time you right-click on a file name, the Open With context menu will have this new entry to open the containing folder.

    Comment

    • Lutz
      Veteran
      • Oct 2007
      • 356

      #3
      Re: Open containing directory

      Enter explorer.exe /n,/e,,/select,%f to select the file directly. This also works with folders and even if multiple files/folders are selected (opens one Explorer for each selected item).

      Greetings Lutz

      Comment

      • markf_2748
        Expert
        • Apr 2008
        • 85

        #4
        Re: Open containing directory

        Lutz's suggestion works nicely but I find that %f must be inside double quotes to locate the file path. Also, the double coma appears to be unecessary. i.e.

        explorer.exe /n,/e,/select,"%f"

        However, no matter how many files and/or folders are selected, I only get one explorer window to open. Not sure why.

        I have wanted this capability for a long time. Thanks.

        Comment

        • Guest's Avatar

          #5
          Re: Open containing directory

          With Build 240, this option only seems to work with files, but for directories there is a built-in "Explore" under the Open With menu (I used "Explorer" for the description of Lutz', and "Explorer P" for the previous suggestion, so "Explore" is something different.

          Also, my right-click has an "Explorer" item right under "Open With", which seems to give access to many of the right-click options you'd see in Explorer, including "Slect Left Side to Compare" ;-}

          /dps

          Comment

          • Lutz
            Veteran
            • Oct 2007
            • 356

            #6
            Re: Open containing directory

            Hi Mark,

            I'm sure, You didn't check 'multiple instances' in the 'advanced' section of the (Tools -> Options -> Open With) Explorer-Item. For default these properties are hidden.

            There are also the options to treat files and/or folders.

            Greetings Lutz

            Comment

            • markf_2748
              Expert
              • Apr 2008
              • 85

              #7
              Re: Open containing directory

              Hello Lutz,

              Cool, very cool. Checking 'multiple instances' as you suggest [...Edit(explorer.exe)->Advanced] solved the problem. Now I can open multiple explorer windows by selecting multiple files and using the local (RMB) menu "Open With -> Explorer".

              However, when I select multiple files I cannot open multiple instances of their associated applications. In fact, when I select multiple files, "Associated App" disappears from the "Open With" local (RMB) menu. Not a great loss, but perhaps it could be nicer.

              Thanks.

              Comment

              • Lutz
                Veteran
                • Oct 2007
                • 356

                #8
                Re: Open containing directory

                Hi Mark, I have two remarks:

                In fact, when I select multiple files, "Associated App" disappears from the "Open With" local (RMB) menu.
                Just add a new 'open with'-Item (ie named 'AssoApp') with the command line 'cmd /c start %f' accepting files, folders and multiple instances.

                To open multiple files in one instance of an application is not possible yet, but I posted this before and its already on the legendary wish list.

                Greetings Lutz

                Comment

                • markf_2748
                  Expert
                  • Apr 2008
                  • 85

                  #9
                  Re: Open containing directory

                  Lutz wrote:


                  [/quote]
                  Just add a new 'open with'-Item (ie named 'AssoApp') with the command line 'cmd /c start %f' accepting files, folders and multiple instances.


                  [/quote]

                  I could not get the above syntax to work. Perhaps you could post an example Open With Command Line entry.

                  Lutz wrote:


                  [/quote]
                  To open multiple files in one instance of an application is not possible yet


                  [/quote]

                  To my surprise, I find that the following "Open With" Command Line opens multiple highlighted *.PDF files in a single instance of Acrobat (no quotes and no %f used):

                  C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat

                  What I would really like is an "Open With" which will perform this action without having to create a special menu entry for each associated application.
                  MarkF

                  Comment

                  • Lutz
                    Veteran
                    • Oct 2007
                    • 356

                    #10
                    Re: Open containing directory

                    Hello Mark!

                    I tried the command line with some folders and (local) word documents only and this worked.

                    Now I tried some other files and figured out, that UNC-paths (limitation of the cmd-shell) and clearcase elements without execute-rights ('access denied') don't work.

                    What files did You use?

                    Nevertheless the selected files must have an associated application (Windows-Explorer/Extras/Folder Settings/File types) otherwise a Windows-'open with' dialog should appear.

                    The behaviour You mentioned with PDF-files seems to have two reasons: %f might be optional in BC-open with-commands (Scooter?) and Acrobat only opens one instance to show multiple files (some programs are configurable to open new files in an existing or a new instance).

                    Perhaps someone knows an alternative shell-command (I think BC uses a windows call for the associated application).

                    Greetings Lutz

                    Comment

                    • Chris
                      Team Scooter
                      • Oct 2007
                      • 5538

                      #11
                      Re: Open containing directory

                      %f might be optional in BC-open with-commands (Scooter?)
                      Yes, %f is optional. If you only include a path to a program and nothing else, it should just pass the filename.
                      Chris K Scooter Software

                      Comment

                      Working...