Re: Controlling Windows Explorer from a script

From: Randy Birch (rgb_removethis_at_mvps.org)
Date: 08/18/04


Date: Tue, 17 Aug 2004 21:13:38 -0400

You can't do it ... you want to display explorer with the subfolders already
expanded. Best you're going to get is along the lines of what I provided -
if you drop the /root part you can navigate higher. You might have to build
your own interface that simulates the look and feel of explorer.
www.mvps.org/btmtz/ is a good place to start -- check out the enumdesk
sample and his other demos that show how to control the listview and
treeview via the api.

-- 
Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"Suresh Govindachar" <initiallast-name@yahoo.xyz> wrote in message 
news:7CxUc.8230$54.121523@typhoon.sonic.net...
: Thanks, but it is not quite what I am looking for.
:
: When I ran it, it opened Windows Explorer with
: "c:\program files" as the topmost level in the left
: pane and the contents of "c:\program files" in the
: right hand pane.  Also, in the left pane, all the
: folders under "c:\program files" were closed ([+] mark).
:
: Here's a made up example of a display I would like
: to see:
:
: Left Pane:
:     * top level is "Desktop"
:                     [-] My Computer"
:     * Folders that have [-] next to them:
:       [-] My Computer"
:           [-] (C:)
:               [-] Windows
:               [-] Desktop
:               [-] System
:                       [-] DirectX
:
:           [-] (D:)
:               [-] d:\opt
:                   [-] d:\opt\one
:     * All other drives and folders in left pane will have [+]
:
: Right Pane:
:     * Contents of the folder d:\suresh\project
:
: For the above example, parameters for the script
: are:
:
: a) Top level:  Desktop
: b) Minus Items in Left Pane:
:   "My Computer", c:, c:\windows, c:\desktop,
:    c:\system, c:\system\directx, d:, d:\opt,
:    d:\opt\one
: c) What to expose on the right hand pane:
:   d:\suresh\project
:
: Please let me know if I need to clarify anything.
:
: Thanks,
:
: --Suresh
:
:
: "Randy Birch" <rgb_removethis@mvps.org> wrote in message
: news:#CwNCcLhEHA.3732@TK2MSFTNGP10.phx.gbl...
: > Are you talking about:
: >
: > Option Explicit
: >
: > Private Declare Function ShellExecute Lib "shell32.dll" _
: >    Alias "ShellExecuteA" _
: >   (ByVal hwnd As Long, _
: >    ByVal lpOperation As String, _
: >    ByVal lpFile As String, _
: >    ByVal lpParameters As String, _
: >    ByVal lpDirectory As String, _
: >    ByVal nShowCmd As Long) As Long
: >
: >
: > Private Sub Command1_Click()
: >
: >
: >    Dim sTopic As String
: >    Dim sFile As String
: >    Dim sParams As String
: >    Dim sDirectory As String
: >    Dim startdir As String
: >    Const SW_SHOWNORMAL As Long = 1
: >
: >    startdir = "c:\program files"
: >
: >    sTopic = "Open"
: >    sFile = "explorer.exe"
: >    sParams = "/e,/root," & startdir
: >    sDirectory = 0&
: >
: >    Call ShellExecute(0&, sTopic, sFile, sParams, sDirectory,
: SW_SHOWNORMAL)
: >
: > End Sub
: >
: >
: >
: >
: >
: > --
: >
: > Randy Birch
: > MVP Visual Basic
: > http://vbnet.mvps.org/
: > Please respond only to the newsgroups so all can benefit.
: >
: >
: > "Suresh Govindachar" <initiallast-name@yahoo.xyz> wrote in message
: > news:jEvUc.8210$54.121572@typhoon.sonic.net...
: > : Hello,
: > :
: > : I would like to write a scritp that will not only launch
: > : Windows Explorer but also "arrange the folders".  By
: > : "arrange the folders" I mean:
: > :
: > :   Start by reading a "layout arrangement" file.  The layout
: > :   arrangement file is just a list of folder names.  The
: > :   very first folder in that list needs to be exposed in the
: > :   right hand pane of Windows Explorer.  All the other
: > :   folders in that list need to be "unfurled in the left
: > :   pane" meaning they need to have a [-] sign next to them
: > :   on the left hand pane of Windows Explorer.
: > :
: > :   (Once Windows Explorer has been launched in this
: > :   manner, the script dies and user works with the Explorer.)
: > :
: > : (I have Microsoft Visual Studio 6.0.  If the commands that
: > : can be used are listed in it, please tell me how to find
: > : them there!)
: > :
: > : Thanks,
: > :
: > : --Suresh
: > :
: > :
: > :
: >
:
: 


Relevant Pages

  • Re: Controlling Windows Explorer from a script
    ... right hand pane. ... > ByVal lpOperation As String, ... > Dim sTopic As String ... right hand pane of Windows Explorer. ...
    (microsoft.public.vb.winapi)
  • Re: Getting Range of a Comment?
    ... Dim st as String ... BTW, if you copy/paste from that pane, you will likely loose the comment ... markers. ...
    (microsoft.public.word.vba.general)
  • Re: How can I determine the width of a string please
    ... >>Since explorer does this already there are probably existing ways of doing it that I have not found. ... >>It would be nice if the method was applicable to any string. ... >Private Sub Form_Load ... >Dim sCompactedPath As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Windows Explorer Opening options?
    ... Malcolm H: ... Right-click on your Explorer shortcut icon and select Properties. ... pane display with 'My Computer' selected in the left hand pane. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Windows Explorer Opening options?
    ... Right-click on your Explorer shortcut icon and select Properties. ... pane display with 'My Computer' selected in the left hand pane. ... When launched I want Windows Explorer ...
    (microsoft.public.windowsxp.help_and_support)