BRC not quite renaming things correctly

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

BRC not quite renaming things correctly

Postby Geeves » Fri Apr 05, 2024 4:35 am

I have a strange issue on this one. I've been using BRC for a while just to check over a directory and advise on any naming issues. This is using the BRC command line, been working great up until recently.

I have the following command line.

Code: Select all
BRC64.exe /DIR:X:\ /RECURSIVE /REMOVECHARS:'"*:<>?/\|' /TRIM /TIDYDS /REPLACECI:'Focus Construction Interiors':'FCI' /REPLACECI:'Focus Management Group':'FMG' /REPLACECS:'~':'-' /NODUP


The idea of the command is to just report back on what needs to be changed, however, when running the above I receive strange results such as the below.
Filename Unit G 39 Garnet Rd-FOCUSL2924.pdf would be renamed to 39d2924.pdf
Filename Unit G 39 Garnet Rd.pdf would be renamed to 39d.pdf
Filename Unit G 39 Garnet Rd.xlsx would be renamed to 39d.xlsx

I thought this could be a system issue, so I have tried this same command on Windows 10 & Windows 11, both 32 and 64 bit. 2 different computers too, both a mapped drive or local file path... but the same results.

Am I being silly? (It has been known to happen).
Geeves
 
Posts: 2
Joined: Fri Apr 05, 2024 4:23 am

Re: BRC not quite renaming things correctly

Postby therube » Fri Apr 05, 2024 4:27 pm

Running from command-line (CMD or Powershell) or batch file?

I'd suspect that something is interpreting (expanding) your /REMOVECHARS= & possibly also that the /RECURSIVE is playing a role too.

So, pull those two items out, or at least the /REMOVECHARS= & give it a spin.

With that, I'll suspect that those results are no longer returned.

Add either the /RECURSIVE= or /REMOVECHARS= back in.
What results are returned?

Now remove what you just added back in & substitute for the other.
Again, what results are returned.


As it is, your /REMOVECHARS= contains some "invalid" (Windows file name) characters, so having those particular characters is atypical (but not impossible).

And I'm thinking that your /REMOVECHARS term itself is actually invalid (at least invalid in the Widows shell sphere), & it only happens to work, by virtue of the the " (quote-mark) being included in there.
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: BRC not quite renaming things correctly

Postby therube » Fri Apr 05, 2024 4:29 pm

And thinking the /RECURSIVE= could be playing in, maybe if some parent directory name might happen to have a particular character that could be causing the /REMOVECHARS= to go haywire?
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

/RemoveChars

Postby Luuk » Fri Apr 05, 2024 9:58 pm

Therube is correct about /RemoveChars, it was never terminated after starting a double-quote.
So everything on the command-line after the double-quote, just adds more characters to be removed.
Even if adding /Execute to the end, the preview just removes more letters like... 'E' 'x' 'e' 'c' 'u' and 't'.
Luuk
 
Posts: 706
Joined: Fri Feb 21, 2020 10:58 pm

Re: BRC not quite renaming things correctly

Postby Geeves » Mon Apr 15, 2024 10:15 am

Thanks for the responses on this one. I have only just got around to re-checking this.
The strange thing for me is that the initial post I made was a command which had been working for 2 years or so without issue, but broke earlier this year.

With your assistance. I have been able to get this working with the below.

Code: Select all
BRC64.exe /DIR:X:\ /REMOVECHARS:"*:<>?/\|" /TIDYDS /REPLACECI:"Focus Construction Interiors":FCI /REPLACECI:"Focus Management Group":FMG /REPLACECS:'~':'-' /TRIM /MAXLEN:255 /RECURSIVE /NODUP


My only guess is that the command was no longer honouring the single quotes outside the double quote in the /REMOVECHARS
(Still running in PowerShell).

Either way, it is working for me now, I appreciate the replies and the assistance on this one.
Geeves
 
Posts: 2
Joined: Fri Apr 05, 2024 4:23 am


Return to BRC Support