I am trying to create a batch file to add the suffix _Reuploads to the basenames of all CZI files in a directory named Reuploads.
The file names in Reuploads follow the basename format AB123456_pX_s0_m0, (sometimes they follow the format AB123456_pX_s0_m0_R1, not sure if this matters?).
I found this code, and edited it, but it does not seem to work.
@for /f "delims=" %%i in ('dir "C:\Reupload" /s /b /a-d ^| findstr /v "_Reupload\.[^.]*$"') do ( ren "%%~fi" "%%~ni_Reupload%%~xi" )
You can try this
But it may be slow because it looks in all the computer for the "reuplods" folder.