by truth » Tue Aug 20, 2013 9:20 am
I dont think BRC makes internally-buffered-data avail as %EnvVar%
However, without /quiet, it always outputs OldName renamed to NewName
You just have the filter the leading-text to isolate NewName by itself
If you write alot of batches, I'd highly recommend sed for input/output filtering
Its a commandline editor that can also modify text inbetween pipes, etc!
Its regex match/replace is very similiar to BRC's /regexp, & perfect for such cases
As an example, the following batchline moves your renamed-files to C:\DirPath
BRC32 /parameters /execute|sed -n -r "s/.*renamed to (.*)/MOVE \"\1\" \"C:\\DirPath\\\1\"/p"|sed e
It matches NewName=\1, then creates & executes the command: MOVE "NewName" "C:\DirPath\NewName"
Note this happens on-the-fly, as each NewName is created - very fast & efficient
Another example, for those who only want to see which files would be renamed if using /execute:
BRC32 /parameters|sed -n -r "s/^Filename (.*)( would be renamed to )(.*)/\1 ---> \3/p"
OrigName1 ---> NewName1
OrigName2 ---> NewName2
You customize the output however you desire, & then output to wherever-you-want (if you want)
You can mod output to a file (to create undo-batches, etc) or just customize how stdout displays