0

I a using this code to create folders from files by their extension

setlocal enabledelayedexpansion
for %%i in (*) do (   
   set "x=%%~xi"   
   set x=!x:~1,400!  
   mkdir "!x!"
   move "%%i" "!x!" 
)  
pause

I need to make letters capital

Stephan
  • 53,940
  • 10
  • 58
  • 91
xeex
  • 9
  • 1
  • 2
    What's with `set x=!x:~1,400!`? Do you expect extensions to be larger than 400 chars? To just remove the dot, `set x=!x:~1` is sufficient. – Stephan Jan 22 '20 at 20:27
  • And how to capitalize the letters? – xeex Jan 22 '20 at 21:56
  • 2
    @xeex - [manually](https://www.dostips.com/DtTipsStringOperations.php#Function.toUpper), basically – SomethingDark Jan 22 '20 at 23:50
  • 1
    But also, Windows is case-insensitive so the .jpg files and .JPG files will end up in the same folder. – SomethingDark Jan 22 '20 at 23:50
  • Thank you for help, I have seen a batch file done that does exactly what I am looking for, creates folders by file extension and capitalizes the names as well. – xeex Jan 23 '20 at 15:01

0 Answers0