Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capitalize first letter of a filename

I have some files in a folder and would like to uppercase the first letter of all the filenames with a certain extension using a batch script in windows.

example cap only *.m

before:

  • foo.m
  • bar.m
  • picture.jpg

after:

  • Foo.m
  • Bar.m
  • picture.jpg
like image 986
L3v3L Avatar asked Mar 21 '23 07:03

L3v3L


1 Answers

for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
 ren %%a*.m %%a* >nul 2>&1
)

Check also this -> https://superuser.com/questions/475874/how-does-the-windows-rename-command-interpret-wildcards

like image 159
npocmaka Avatar answered Mar 28 '23 14:03

npocmaka