Button to cycle through folders of same level

I would like to have buttons to cycle through folders of same level both FORWARD and BACKWARD.

For eg:
In a directory structure like:

Parent 1 >
Child 1
Child 2
Child 3

Suppose, I am viewing the folder "Child 2"
I would like to cycle through to Child 3, Child 1, Child 2... (Forward Button)
and also cycle through to Child 1, Child 3, Child 2... (Backward Button)

Pl help... Thanks!

I'm not sure I understand what you want, but it sounds like you can do this simply by using the folder tree to cycle from one subfolder to the next. You could even click the desired folders in the tree in the order you want to view them and then use the lister "Forward" and "Back" buttons to cycle through the folders.

In other words, what would a custom made button do for you that the above wouldn't?

I think you understood it!

I have my folder tree configured to expand a node on selection.. so, its a bit inconvinient to select the next subfolder, if the currently selected sub-folder has lot of sub-sub-folders
And, I usually have the folder tree turned off.. so, a button would be easy instead of turning on the folder tree just for this sake.
And if there is a button, I can assign a shortcut for it too!

In this case the "Forward" and "Back" buttons would include paths beyond the selected desired folders.. so, it wouldnt "cycle" within the desired folders

Thanks!

someone pl help me on this asap... thanks!

The only way I can think of to do this is with an Opus button running an external batch file. In my example here I named my batch file

D:\Mine\cmd\Test.cmd

and the following is what is in that batch file

[code]@rem BEGIN BATCH FILE
@echo off
if "%~1" == "" exit
pushd %2
for /f "delims=" %%a in ('dir ".*" /b/a:d') do (
call :doit "%%~a" "%~1"
)
dopusrt /cmd Go "%X%"
popd
exit

:doit
if not defined X set X=%~f1
if "%T%" == "On" dopusrt /cmd Go "%~f1" & popd & exit
if "%~2" == "%~f1" set T=On
goto:EOF
rem END BATCH FILE
[/code]

Next in customize mode create a new button and give it the following commands

@runmode hide "D:\Mine\cmd\Test.cmd" {s} {s|..}

Make sure you replace D:\Mine\cmd\Test.cmd with the fully qualified name of your batch file.

To use it, you first have to be in one of the subfolders you want to cycle through. Each time you push the button you should jump to the next subfolder on the same level as the folder you are in. When you reach the last subfolder pressing the button again should send you back to the first one.

Oops! It din't work... I coped the content to a text file and renamed it as Text.cmd and copied it to C:\ and then created a button.
But, nothing happens when I click the button!!

You might need to set the button's Function drop-down to MS-DOS.

What version of Windows are you using?
What version of Opus are you using?
What folder was your active lister in when you pressed the button?

(It won't work from folders like My Computer)

Aaah! It works when I set the button's function to MS-DOS.. Thanks a lot!!!

Also pl confirm: ...not very important, though :wink:

  • Is there a way to skip hidden files or system files while cycling?
  • Can there be a backward cycling button?

Btw, I use the latest Dopus on Windows XP

EDIT:

To be read as hidden folders or system folders

You can tell Opus to hide hidden/system files and folders via a filter or preferences, but the script is not part of Opus so it will at least attempt to cycle through all folders whether Opus will show them or not. To force the script to not cycle through hidden/system folders use the following script instead.

[code]@rem BEGIN BATCH FILE
@echo off
if "%~1" == "" exit
pushd %2
for /f "delims=" %%a in ('dir ".*" /b/a:d-s-h/o:n') do (
call :doit "%%~a" "%~1"
)
dopusrt /cmd Go "%X%"
popd
exit

:doit
if not defined X set X=%~f1
if "%T%" == "On" dopusrt /cmd Go "%~f1" & popd & exit
if "%~2" == "%~f1" set T=On
goto:EOF
rem END BATCH FILE[/code]

And to cycle backwards, use this script.

[code]@rem BEGIN BATCH FILE
@echo off
if "%~1" == "" exit
pushd %2
for /f "delims=" %%a in ('dir ".*" /b/a:d-s-h/o:-n') do (
call :doit "%%~a" "%~1"
)
dopusrt /cmd Go "%X%"
popd
exit

:doit
if not defined X set X=%~f1
if "%T%" == "On" dopusrt /cmd Go "%~f1" & popd & exit
if "%~2" == "%~f1" set T=On
goto:EOF
rem END BATCH FILE[/code]

The button code is the same as before.

Thats Sooper Cool :slight_smile: Thanks!

Hello, these buttons were working well until recently... suddenly, have stopped working
I can't figure out why.. plz help, its annoying