I have below script that add a prefix to all files available in a folder.
how to include another if statement that if a file name already contains A23_ as prefix in the folder it should skip it?? pls help. thxs
for /r "%dir%" %%A in (*.txt) do (
if not "!txt:~0,13!"=="%pfx%" ren "%%A" "%pfx%%%~nxA"
Discussion forum for all Windows batch related topics.
2 posts • Page 1 of 1
Your code is comparing 13 characters of the file name to 4 characters of your prefix string. That will never be true.