Re: Controlling Windows Explorer from a script

From: Suresh Govindachar (initiallast-name_at_yahoo.xyz)
Date: 08/20/04


Date: Fri, 20 Aug 2004 20:02:33 GMT


Once Windows Explorer has opened at the top-most
level, isn't it possible to send "SendKeys" commands to
it to expand the specified subfolders in the desired way?

The preceding assumes that a script can command
Windows Explorer to return to it the list of all the folders
-- this list is required to know what key strokes to
generate to get to the desired folders.

Is the problem with the above idea the fact that
there is no way to know for the script to know the
list of folders and so it does not know what key strokes
to generate?

--Suresh

"Randy Birch" <rgb_removethis@mvps.org> wrote in message
news:ek5LZCMhEHA.3676@TK2MSFTNGP12.phx.gbl...
> 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: Where to go with a suggestion to return to classic office inte
    ... I was connected via VPN and something failed in the windows explorer and my ... Microsoft has always provided a classic interface. ... Accountant) use a few commands or functions frequently - you can out those ...
    (microsoft.public.office.misc)
  • Re: "Specified path does not exist" Error
    ... I didnt think this would mater since I get the error when I open the ... file in Windows Explorer too. ... The content of the target field is: C:\TM\TM.exe ... While still in the Command Prompt, type these commands: ...
    (microsoft.public.windowsxp.general)
  • Re: Wheres the saved files from deleted users
    ... folder Bill Hepburn is not under Documents and Settings. ... What I said in my notes are that when using WINDOWS EXPLORER ... using DOS commands (If indeed I have all those old commands available to ... I tend to rule out reason a). ...
    (microsoft.public.windowsxp.general)
  • Re: explore function
    ... enter on of the following commands. ... The first command will open Windows Explorer with your My Documents folder ... How To Customize the Windows Explorer Views in Windows XP ... The bottom line is that you can create a shortcut that opens Windows Explorer ...
    (microsoft.public.windowsxp.basics)
  • Re: explore function
    ... enter on of the following commands. ... The first command will open Windows Explorer with your My Documents folder ... How To Customize the Windows Explorer Views in Windows XP ... The bottom line is that you can create a shortcut that opens Windows Explorer ...
    (microsoft.public.windowsxp.basics)

Loading