Go to Mirror / Sister Folders in other Drives

Features wanted...
Post Reply
Yogui
Posts: 19
Joined: 21 Jul 2011 14:44

Go to Mirror / Sister Folders in other Drives

Post by Yogui »

Hi,
I have the same folder structure in my Pendrive, Local and Network Drives
(The pendrive is the Master set, XYplorer runs portable)
As the Drive letters change (per PC) and the structure is large Favourite folders wont work for me to quikly Navigate/Open New Tab from one Drive to the other/s
Can this be implemented?
Menu "Go" then submenu "Go to mirror in Drive..."
Then a small menu with the list of available paths that match the current one by are in an other drive.
So if the current path is "D:\GIS\Resources\Modules"
Any path thah exist and is like "?:\GIS\Resources\Modules" should be included in the list

If wanna make it even better in the menu show the [Drive label] so its easier to select the right one e.g.
[Portable] H:\GIS\Resources\Modules
[Network] Z:\GIS\Resources\Modules
Thanks, Yogui

highend
Posts: 14672
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Go to Mirror / Sister Folders in other Drives

Post by highend »

Easily achievable via scripting.

Code: Select all

    // Drive types: 2 = Removable | 3 = Fixed | 4 = Remote
    $partialCurPath = substr("<curpath>", 3);
    $localDrives = get("drives", 3);
    $removableDrives = get("drives", 2);
    $networkDrives = get("drives", 4);

    $allDrives = $localDrives . "|" . $removableDrives . "|" . $networkDrives;
    $allDrives = formatlist(replace($allDrives, substr("<curpath>", 0, 3)), "e");

    $selectList = "";
    foreach ($drive, $allDrives, "|") {
        if (exists($drive . $partialCurPath) == 2) {
            if ($localDrives LikeI "*$drive*") {
                $selectList = $selectList . "[Local] $drive$partialCurPath" . "<crlf>";
            } elseif ($removableDrives LikeI "*$drive*") {
                $selectList = $selectList . "[Portable] $drive$partialCurPath" . "<crlf>";
            } elseif ($networkDrives LikeI "*$drive*") {
                $selectList = $selectList . "[Network] $drive$partialCurPath" . "<crlf>";
            }
        }
    }
    if ($selectList) {
        $selectedPath = inputselect("Choose your path...", $selectList, "<crlf>", 4);
        $selectedPath = replacelist($selectedPath, "[Local] |[Portable] |[Network] ", "", "|");
        tab("new", $selectedPath);
    } else {
        status "$partialCurPath not found on any other volume, aborted!", "FF0000", "stop";
    }
One of my scripts helped you out? Please donate via Paypal

Yogui
Posts: 19
Joined: 21 Jul 2011 14:44

Re: Go to Mirror / Sister Folders in other Drives

Post by Yogui »

:appl: Thanks for that!
Still need a minor improvement with the current Drive (removed) that still show in the input select
How does it handle the \\NetworkAddress and Desktop, Computer etc CLSID List (Windows Class Identifiers) paths?
It should fail (nicely) since there is no Mirror Folder Structures
Thanks, Yogui

Post Reply