Jump to content

Recommended Posts

Posted

Hi all,

When my program starts, i need to get the currently opened folder path in windows explorer. How to get the path. Thanks in advance. :)

  Reveal hidden contents

 

Posted

@faustf

Thanks for the reply, but no. @ScriptDir is not for my case. I will compile this program as an exe and when i run this program, what ever folder is open in explorer, i need to get it's path. Not the script directory. AFAIK, script directory is where the script/exe file resides. That's not what i want. :)

  Reveal hidden contents

 

Posted
  On 6/6/2020 at 2:33 PM, kcvinu said:

When my program starts, i need to get the currently opened folder path in windows explorer.

Expand  

It is already an older thread, but maybe it is what you are looking for  : windows-explorer-current-folder

Since links get lost sometimes, here for the sake of convenience the related code in a spoiler.

  Reveal hidden contents

 

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

What if you have more than one folder open? What folder considered the one that you need?

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

@Musashi,

That Function will loop through all opened explorer windows. I just need only the last used/opened window. 

Anyways, it seems that things are little bit different than i expected. I thought that the folder path would be a simple property of Shell object.(like $Shell.ActiveFolder.Path). But this Function shows that it is not. Thanks for pointing me the right direction.

 

@MrCreatoR,

If there is more than one folder opened, then i need the last opened folder's address.

  Reveal hidden contents

 

Posted (edited)

@argumentum,

Thanks a lot. It will give the active explorer window's title. Now, i can get the hWnd of active explorer window and tweak Melba's KaFu's & Ascend4nt's solution which @Musashi pointed.

Edited by kcvinu
  Reveal hidden contents

 

Posted

@argumentum, It seems that, i can achieve my goal only with your single line code if i turn on "Display full path in title bar" option in folder options. :)

  Reveal hidden contents

 

Posted
  On 6/6/2020 at 6:09 PM, KaFu said:

Not Melbas solution (this time🤣).

Expand  

No, surprisingly not :lol:.

Normally I always name the author(s) when mentioning sources, so that acknowledgements go to the right address. Since they are listed in the function headers, I assumed that would be sufficient. For reasons of politeness among programmers, here is the corresponding addendum :

Author : @Ascend4nt , based on code by @KaFu , klaus.s

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

@KaFu

Oops Sorry, my mistake. I only see that the code was posted by Melba. I didn't read the comments in code. My bad. I will edit my reply. Sorry for the mistake.

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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