I need a batch-file that modifies some file names for me. The files all look like this:
abcd12345.csv
and I have to get rid of the numbers. It's also always the same amount of numbers that I have to cut off.
So far I found this:
Code: Select all
for %%i in (D:\"Documents and Settings"\....\test\*.csv) do @(
for /f "delims=1234567890" %%a in ("%%~ni") do @(
ren "%%i" "%%a%%~xi"
))
and it works... kind of... it does the cutting, but only on one file. So something must be wrong with the for-loop
The echo prints out: "A duplicate file name exists or the file cannot be found"
Anyone see my mistake?
Best regards,
Patrick