Looking to setup a scheduled task to append a prefix "Arch" to files that only reside in folders named "Archive" and ignore the rest using Bulk Rename Command.
A bonus would be if it already has the "Arch" prefix, to leave it as is.
The below batch works, but note your folder-name match is case-insensitive. It works recursively, but only in folders named archive, Archive, etc. Files already beginning as Arch* will be left alone.
@echo off For /f "delims=" %%A in ('dir/b/s/ad Archive*') DO @If /i "%%~nA"=="Archive" ( brc32 /Dir:"%%A" /NoFolders /Prefix:Arch /Regexp:"^(Arch)+(.*):Arch\2" /execute) echo. echo. echo.Done, press any key to exit. pause>nul
I ran the example you gave me and it ran without error but didnt seem to rename any of the files. Here's what I ran and screenshots below of results. I figured I will test manually first before creating a batch file. C:\BRC\BRC64.exe /removename /appendfolder:P::1 /pattern:*.TXT /recursive