by 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