I have a batch file that essentially finds all the pdf files in a folder, and gives them a prefix. SO example: file1.pdf
& file2.pdf
. When the batch file runs, it adds a prefix, let's say "new" to each file. New - file1.pdf
& New - file2.pdf
.
I'm unsure of how to get this to check to see if this file already contains this prefix and skip it if true. Here's my current code:
set strPrefix=New -
set fname=*.pdf
for %%f in (%fname%) Do echo Rename file "%%f" to "%strPrefix%%%f"
for %%f in (%fname%) Do ren "%%f" "%strPrefix%%%f"