Drives remain in Mini Tree

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Drives remain in Mini Tree

Post by LittleBiG »

Zombie tweak = 0. Drives stay in Mini tree even if they are not accessible anymore. Not too nice:
Attachments
drives.png
drives.png (1.29 KiB) Viewed 2659 times

admin
Site Admin
Posts: 65385
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Drives remain in Mini Tree

Post by admin »

That's by design. For years. The idea: The availability of some drives is notoriously volatile (mapped drives, CD-ROM...). This should not affect the tree.

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Drives remain in Mini Tree

Post by LittleBiG »

But years before we didn't use that many drives. We were happy if we had a pendrive. Now I have more than five in use and a portable hard drive. Additionally I have encrypted partitions which are mounted as a removable drives occasionally. Time has changed. I could do with an improvement here. Now my mini tree has 2 parts: folders I use and unmounted drives I don't.

admin
Site Admin
Posts: 65385
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Drives remain in Mini Tree

Post by admin »

Hmm, this will need deeper thinking. This feature is there for lots of years and nobody ever complained. I won't touch it now.

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Drives remain in Mini Tree

Post by LittleBiG »

I have just received a confirmation, that I am right and this can be a problem for others too. A colleague who is fairly new to XY (and I help him with my knowledge to use XY in an optimal way) came to me with the question, how he could remove the obsolete removable drives from his mini tree. He couldn't understand why they were there, although the AllowZombies setting was off and he was sick and tired to do it manually by hiding.

Maybe other people also face with this problem, so I can give a possible solution. Create a new script file called ClearDrives.xys in your Script folder with this content:

Code: Select all

//CLEAR OBSOLETE DRIVES FROM THE MINI TREE
  //if the mini tree is on
  if (get("#489")) == 1 {
    $minidrives = "";
    //check each path to find drives
    foreach($minipath, get("Tree"), "|",, "") {
      if (strlen($minipath) == 3) {$minidrives = $minidrives . $minipath . "|"}
    }
    //select the mini tree drives which are not in use at the moment
    $minidrives = formatlist($minidrives,"ef","|","!".get("drives"));
    //remove them from the mini tree
    if ($minidrives != "") {
	  loadtree "$minidrives", 2; 
	  status "Cleared drives: " . replace($minidrives,"|"," ");
	}
	else
	{
	  status "Nothing to clear.";
	}
  }
ClearDrives.xys
(654 Bytes) Downloaded 162 times
Then modify the XY shortcut in order to run the scipt after every start:

Code: Select all

XYplorer.exe /script=ClearDrives
Last edited by LittleBiG on 11 Apr 2014 13:29, edited 1 time in total.

Stef123

Re: Drives remain in Mini Tree

Post by Stef123 »

Excellent. :appl: Even a newbie like me could immediately run it, thanks to your complete instructions.

May I ask you a favor? Could you come up with a similar script (or point me towards one) that clears out my broken entries in recent folders? Unless there is an easier way of course, that I am not aware of.

I wouldn't mind if the whole recent list gets cleared. Actually, I am more concerned with the Hotlist - a great feature, love it - but it's cluttered with invalid entries. I wouldn't mind starting over every session with a blank list. Still better than all these warning signs. I know how to clear the list manually, but if there is an easy way to automate it, I'd prefer that, of course.

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Drives remain in Mini Tree

Post by LittleBiG »

Stef123 wrote:May I ask you a favor? Could you come up with a similar script (or point me towards one) that clears out my broken entries in recent folders? Unless there is an easier way of course, that I am not aware of.
What I can offer you is here: http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=11458

admin
Site Admin
Posts: 65385
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Drives remain in Mini Tree

Post by admin »

OK, you softended my heart. I will extend the Zombie setting to drives.

Stef123

Re: Drives remain in Mini Tree

Post by Stef123 »

Thank you.
Don't want to exploit your soft heart, but since you offered it yourself: Are those dual-pane parameters still on your radar? The work-arounds are not nearly as straightforward as LittleBig's ClearDrive. I think a lot of users would benefit from them:
http://www.xyplorer.com/xyfc/viewtopic.php?f=3&t=11413

admin
Site Admin
Posts: 65385
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Drives remain in Mini Tree

Post by admin »

I added this already:

Code: Select all

    + New variables to return the unslashed path of each pane:
        echo <path 1>;    //pane 1
        echo <path 2>;    //pane 2   

Stef123

Re: Drives remain in Mini Tree

Post by Stef123 »

Beats me how I could have overlooked those lines from Apr 4th
Thanks.

Post Reply