apply rename to selected folders only in Total Commander

Post any Bulk Rename Command support requirements here. Open to all registered users.

apply rename to selected folders only in Total Commander

Postby tripfog » Fri May 02, 2014 9:02 pm

hi, I have a button on Total Commander that I want to use to add some words to an ONLY SELECTED folder name.

I'm using this parameter
brc32 /nofiles /insert:"(1990) ":1 /execute

works very well but this aply to ALL folders instead to only SELECTED folders.
I want to apply only to selected folders.

any help will be very welcome, thanks!
tripfog
 
Posts: 2
Joined: Fri Feb 26, 2010 8:27 pm

BRC's name-selectors are /Pattern and/or /Regexp

Postby truth » Sat May 03, 2014 2:03 am

When /pattern: isnt spec'd, all-names are matched/selected by default!
If /pattern:text-to-match (wildcards-accepted) isnt selective-enough to spec your DirNames:

Use /regexp:match:replace versus /insert
Note that /insert matches everything spec'd by /pattern (all-by-default)
/Regexp allows a sub-selection of /pattern:'s matched-names, so its far more specific.

Just post back with DirNames if you need any help matching them.
If DirNames are unknown (yet to be selected by Total Commander, see next post)
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay

Place ParentDirectoryVariable in either /pattern or /regexp

Postby truth » Sat May 03, 2014 9:53 am

If you wish to dynamically match DirNames by selecting them (versus by DirName),
you must specify the correct TotalCommander environment variable within BRCs options.

Sorry, I dont know TotalCommander %var-names, an un-expanded template would be:
brc32 /nofiles /dir:"SelectedDirPath\.." /regexp:"^(SelectedDirName)$:(1990) \1" /execute

Note /regexp is used versus /pattern in-case you ever need to match DirNames with spaces
/Pattern uses space as a delimiter to spec more name-matches, so it cant match spaces, even when quoted.

Even if TotalCommander doesnt have SelectedDirName as a %var, you can prob use FOR to match it.
Below is an example that works for Windows Explorer, note that Explorer uses %1 for DirPath,
but doesnt have a DirName %var, so FOR is used to match-it, & create the proper BRC commands.

- Windoze Explorer Only -
Create the following registry key:
HKEY_CLASSES_ROOT\Folder\shell\Prefix(1990)\command
Then click command, & set default in right-pane to:
cmd.exe /c "for /f "delims=" %%a in ("%1") do brc32 /dir:"%1\.." /nofiles /regexp:"^(%%~na)$:(1990) \1" /execute"

It allows the user to select multiple-folders to be renamed as described.
Note its much simpler to do this with REN, but this gives a basic BRC-example to mod for more detailed-renames
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay


Return to BRC Support


cron