Toggle Drive, But Retain Path

I would like to have a button that would toggle between two folders, having the same path (except for..) but in two different root directories..

For Eg: The button should toggle between
[b]D:[/b]Folder1\Folder2\Folder3\ and
[b]D:[/b]Folder4\Folder5\ and

Thanks for any help :slight_smile:

You could create three buttons (LMB MMB RMB)

Three Buttons: A toggle which switches the button between single and multi-function mode. In this mode, the button is turned into a submenu with a maximum of three functions, and these functions are accessed directly via the left, right and middle mouse buttons (rather than through a pop-up menu).

Customize -> right click toolbar -> new-> new button -> right click new button -> three button

Sample button code:

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none" type="three_button"> <label>Toggle Folders</label> <icon1>#newcommand</icon1> <button backcol="none" display="both" textcol="none"> <label>Drive D</label> <tip>Drive D</tip> <icon1>#newcommand</icon1> <function type="normal"> <instruction>Go &quot;D:\Folder1\Folder2\Folder3\&quot;</instruction> </function> </button> <button backcol="none" display="both" textcol="none"> <label>Drive F</label> <tip>Drive F</tip> <icon1>#newcommand</icon1> <function type="normal"> <instruction>Go &quot;F:\Folder1\Folder2\Folder3\&quot;</instruction> </function> </button> </button>

Actually, I wanted something different..
I want the toggle to be dynamic and not specific to a particular path..
i.e. the path, after the root directory does not really matter
In the Eg. I gave,
the portion "\Folder1\Folder2\Folder3" can be anything

should be toggled to

I hope I am clear now :wink:

Hi anjan,

got a similar idea like you and eventually did a small batchfile now,
which should do the trick.

Create a button and launch "\ToggleDrive.bat {s}"

Edit ToggleDrive.bat to your needs (change the driveletters, I switched
between C: and D:) and set the path for your dopusrt.exe (within dopus

Hit the button!.. o)

Paste this into ToggleDrive.bat anywhere on your disk.

if /I %DRIVE%==C (set DRIVE=D) else (if /I %DRIVE%==D set DRIVE=C)
D:\bin\file\DOpus\dopusrt.exe /cmd go %DRIVE%%FOLDER%

Thanks for your help, tbone!
But, for some reason, it dint work..

Toggle Drive.bat

Button Created:

Error Message that I got:

So, I changed the bat file a bit:

just added quotes to the path

Still it dint work..
i.e. the folder viewed is the same, it doesnt change
But, it did not show the error message

How do I proceed?? :unamused:

hey anjan..

obviously you are a serios fan of white spaced file and folder names ?!.. o)
I suggest to quit naming items like this.. it is often and always a guarantee
for hassle of any kind.. o) But.. there's a solution of course.. o)

The modified script (make same changes as before plz.. o)):

if /I %DRIVE%==C (set DRIVE=D) else (if /I %DRIVE%==D set DRIVE=C)
D:\bin\file\DOpus\dopusrt.exe /cmd go "%DRIVE%%FOLDER%

Now modify the launching, and enclose the {s} in ", like this:
"c:\program files\directory opus\toggle drive\toggle drive.bat" "{s}"

Should do it, tried it here with foldernames containing spaces.
If not.. just scream.. o)

[quote="tbone"]obviously you are a serios fan of white spaced file and folder names ?!.. o)
I suggest to quit naming items like this.. it is often and always a guarantee
for hassle of any kind.. o)[/quote]

It's 2008 not 1975 - time to move on - file/folder names containing spaces are the norm these days.

Users just need to remember to enclose paths in quotes where required.

AWESOME :sunglasses: Thanks tbone!!
Now it works flawlessly

Just added this..

@runmode hide

at the beginning of the button command
so, the dos window does not show up each time it is executed


I'm glad you like it.. o)
The @runmode thing makes it nearly perfect, you're right!.. o)

I know it's 2008, I try to avoid using spaces though. At first place in
foldernames, as it can get annoying if you use shell/cmd often and need
to handle the extra quotes. In filenames, well.. my mp3s contain spaces
at least.. and there are situations, where you simply are stuck, if you try
to escape special characters, need the quotes because of spaces in paths,
and at the same time want the " or ' to be part of a string. I guess you
know what I mean, but hey.. just lemme do it my way, I'm kinda outschool.. o))