Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Oct 2009
    Posts
    8

    Grin How do I explore to folder and target file?

    I'm wondering how to open explorer to the target file's location and also select that filename. I know how to make it open the target folder, but I can't figure out how to make it select the file too. Hopefully this makes sense.

    Thanks in advance for any guidance.

  2. #2
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    AFAIK there is no api to accomplish this -- you could easily use autoit to script that added functionality.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  3. #3
    Join Date
    Jun 2007
    Location
    London
    Posts
    700
    Script / Add Action / File / File.run / Next / click on "AutoPlay\\Docs\\MyProg.exe" / browse to file

    Hope this works for you

  4. #4
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Use the next function to open a new explorer window and select the given folder/file.

    Code:
    function ExploreSelect(sPath)
    	File.Run(_WindowsFolder.."\\explorer.exe", "/select,\""..sPath.."\"", "", SW_SHOWNORMAL, false);
    end
    Then call it like (example)
    Code:
    ExploreSelect(_WindowsFolder.."\\notepad.exe");
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  5. #5
    Join Date
    Aug 2003
    Posts
    2,427
    Forgive the question, I'm sure that I must be missing something but, if you want to 'Explore' to a known folder/file and then open it, why not just use File.Run?

  6. #6
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    people, he wants to open the folder in explorer and select a file in it. You know, a 'browse to file in itunes' kinda thing
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  7. #7
    Join Date
    Aug 2003
    Posts
    2,427
    Quote Originally Posted by Imagine Programming View Post
    people, he wants to open the folder in explorer and select a file in it. You know, a 'browse to file in itunes' kinda thing
    I was looking at -
    the target file ..... make it select the file too
    I sometimes make the mistake of reading things too literally

  8. #8
    Join Date
    Jul 2007
    Posts
    1,512
    Nice function Imagine Programming

  9. #9
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by longedge View Post
    I sometimes make the mistake of reading things too literally
    Yeah I understand, sometimes I do that too lol.

    Quote Originally Posted by rexzooly View Post
    Nice function Imagine Programming
    Thank you, I recall I had some help from the IR community on this subject a big while back, so there should be a thread about it somewhere
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  10. #10
    Join Date
    Oct 2009
    Posts
    8

    Talking

    Quote Originally Posted by Imagine Programming View Post
    Use the next function to open a new explorer window and select the given folder/file.

    Code:
    function ExploreSelect(sPath)
    	File.Run(_WindowsFolder.."\\explorer.exe", "/select,\""..sPath.."\"", "", SW_SHOWNORMAL, false);
    end
    Then call it like (example)
    Code:
    ExploreSelect(_WindowsFolder.."\\notepad.exe");
    This is EXACTLY what I needed. Thank you!!!!

  11. #11
    Join Date
    Dec 2008
    Posts
    46

    Thumbs up explorer parameter

    nice work 'Imagin programing'!!

    let me explain more:

    these are the useful explorer parameter"

    Option Function
    ----------------------------------------------------------------------
    /n Opens a new single-pane window for the default selection. This is usually the root of the drive that Windows is installed on. If the window is already open, a duplicate opens.

    /e Opens Windows Explorer in its default view.

    /root,<object> Opens a window view of the specified object.

    /select,<object> Opens a window view with the specified folder, file,or program selected.

    Examples
    -----------------------------------------------------------------------
    Example 1: Explorer /select,C:\TestDir\TestProg.exe
    Opens a window view with TestProg selected.

    Example 2: Explorer /e,/root,C:\TestDir\TestProg.exe
    Opens Explorer with drive C expanded and TestProg selected.

    Example 3: Explorer /root,\\TestSvr\TestShare
    Opens a window view of the specified share.

    Example 4: Explorer /root,\\TestSvr\TestShare,select,TestProg.exe
    Opens a window view of the specified share with TestProg selected.


    Explorer.exe /e,/idlist,%I,%L From Folder\..\Explore in the registry

    %I - ID number

    %L - Long filename

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts