Jump to content

One session is possible ?


Recommended Posts

I have done this small script but i want that every choice that i make
open the folder choosed in same window that i already have on screen and not multiple 
session of "explorer.exe" .   How change i must do to script to obtain this under my Win7-64 bits ?
   Thanks.


#NoTrayIcon
$Choice="Folder 1  into  C:\ =  one" & @LF & "Folder 2  into  D:\ =  two" & @LF & @LF & "Computer Folder =  pc" & @LF & "Desktop =  desktop" & @LF & "Recycle Bin =  trash" & @LF & @LF & "Control Panel =  panel" & @LF & "GOD-MOD Config =  settings" & @LF & "Exit =  out" & @LF & @LF & @LF & "YOUR   CHOICE  IS :"

While 1

   $Path=InputBox("Choices", $Choice, "One", "", 80, 280, -1, @DesktopHeight-300)

   Select
      Case $path="one"
               $Path="C:\folder-1"
      Case $path="two"
               $Path="D:\folder-2"
      Case $path="Desktop"
               $path="shell:desktop"
      Case $path="trash"
               $path="shell:RecycleBinFolder"
      Case $path="pc"
               $path="shell:MyComputerFolder"
      Case $path="panel"
               $path="Shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}"
      Case $path="settings"
               $path="Shell:::{ED7BA470-8E54-465E-825C-99712043E01C}"
      Case $path="out"
               Exit
      Case 1=1
               $path=""
   EndSelect

   If $path<>"" then Run("explorer.exe" & ' "' & $path & '"')

Wend

Link to comment
Share on other sites

If I understand you correctly, only one Explorer window is to exist.  Any display should use that window only.

My thinking would be to check for explorer.exe already running.  If so, make the window active and use Send() to put the characters into the addresss line.  I dib;t know of any command line switch that prevents a new window from opening, if say the user has the system set to open folders in a new window.  The macro approach is the only one I can think of in this case.

Link to comment
Share on other sites

Thanks MilesAhead for reply.

I have proved to do this but when i send into adress Bar all string, it is not submited using function send if there are "space" into

folder name example "c:My Folder 1"

I have asked on forum for this function to open folder in same session because installing program "classic shell"

http://www.classicshell.net/

in its toolbar i can create a lots cutom button with shortcut to all folders that i want inserting prefix "open".

Infact if i create 2 or more buttons using

OPEN C:My Folder 1

OPEN C:My Folder 2

and cliccking on them explorer change folder in same windows without opening more sessions of it

I need to do the same thing but using script command for my other use.

How this program send correct instructions to explorer ??

If someone have solution please give me help.

Thanks

Link to comment
Share on other sites

Nothing to do with _IEattach, explorer don't open folder.
I have proved also
_ieNavigate and _IEcreate and with _IECreate, script causes an error of While-Wend into function.

I'm disconsolate to don't find solution, when using program "Classic shell" i need to insert
in the button that i'm creating only word "open" before destination folder to obtain that i want.  :-((
 

Link to comment
Share on other sites

I have send mail to author of program "classic shell" in order to know how he has realized this.

He don't uses script but has sended me links that help me for my design:

http://blogs.msdn.com/b/oldnewthing/archive/2013/04/22/10412906.aspx

....and this....

http://blogs.msdn.com/b/oldnewthing/archive/2004/07/20/188696.aspx

..but i don't know this kind of script.

Please some member can look links in order to understand, (if you know that code), if script do that i'm looking for

and if is possible to convert it into AutoIT script ?

Thanks again

Edited by mercadantelaura
Link to comment
Share on other sites

The only way that i have done to do this (also if it is very bad way)
is insert in a variable the actual path of active window (from Windows title),

then close active Windows and open again explorer with

Run ("explorer &  "variable")

It takes 1 second each folder that i want open
but is only way found to do this.  :-((

Edited by mercadantelaura
Link to comment
Share on other sites

  • 4 weeks later...

Searching on web i found that exist a command line of explorer.exe as

Explorer.exe /e,/idlist,%I,%L

%I - ID number
%L - Long filename

I have understood that it was be able to solve my problem opening new folder that i want
in same window of my old folder path as do when user click with mouse iver a tree folder.
Window open that folder in the same window an user can navigate from one folder to an other
without open other sessione of explorer

I have proved using function "run" with all options
%I i have inserted $PID  or  $handle
and into $L i have used new folder path that i want navigate to
using same window session.

Unfortunately it don't take effect

Please, please if you can, give me a hand.
Someone can solve my problem i'm crazying to read on web lots guides but in these weeks

i don't have found solution.

Thank you very much.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...