computing
  • 3

Solved How To Make a Filename Uppercase In Batch

  • 3

I’ve been searching the internet for code to change FILENAMES to all UpperCase letters.

I’ve found a few lines of code like the following:
FOR /F “tokens=2 delims=-” %%A IN (‘FIND “” “%~1” 2ˆ>ˆ&1’) DO SET UpCaseText=%%A

but I only get error messages.

I found the following for making everything lowercase, but don’t seem to be able to go the other direction:
FOR %%B IN (“%~1”) DO (
FOR /F “delims=~” %%A IN (‘ECHO %%Bˆ> ~%%B ˆ& DIR /L /B ~%%B’) DO (
SET LoCaseText=%%A
DEL /Q ~%%B
)
)

I want to change every PDF in a folder to uppercase, but can only use something that windows comes ready for (such as VB or Command Line/Batch files).

Share

1 Answer

  1. @echo off
    pushd Your_Folder
    echo.Processing in progress...
    for %%i in (*.pdf) do for /F "tokens=1*" %%j in ('find "" "%%i"') do ren "%%i" "%%k"
    echo.DONE.
    popd
    

    • 0