-2

Using a batch file is there a way that I can strip off the .failed extension for first 1000 files from all files in a directory.

For example

1.pdf.failed => 1.pdf 2.pdf.failed => 2.pdf

DayaBM
  • 19
  • 3

1 Answers1

0

this should work

FOR %%f IN (*.pdf.failed) DO RENAME "%%f" "%%~nf"

If you want to do it only for XX first files, define a variable count and increment it on each loop itineration. When the number is reached, break the loop. See how to break the loop here : How to break inner loop in nested loop batch script

Community
  • 1
  • 1
Jurion
  • 1,230
  • 11
  • 18