(view source code of locase.cmd as plain text)
/* Rename file(s) to all lower case *//* Written by Rob van der Woude *//* http://www.robvanderwoude.com *//* Parse command line parameters */lfn = ""
parse upper arg '"'filespec'"' dummy"/"option
if filespec = "" then do
parse upper arg filespec dummy"/"option
endelse do
/* Long file name detected */lfn = '"'
endif dummy <> "" then call Syntax
if filespec = "" then call Syntax
if option <> "" then do
option = left( option, 1 )
if option <> "S" then call Syntax
end/* Initialize RexxUtil */if RxFuncQuery( SysLoadFuncs ) = 1 then do
call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
call SysLoadFuncsendcall SysFileTree filespec, "file.", "FO"||option
if file.0 = 0 then call Syntax "FileNotFound"
do i = 1 to file.0
newname = translate( filespec( "N", file.i ), "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ" )
say "1B"X||"[1;1H"||"1B"X||"[K"||newname||"0D0A"X||"1B"X||"[K"||"1B"X||"[1A"
address CMD "@CMD /C REN "||lfn||file.i||lfn||" "||lfn||newname||lfn
endEXITSyntax: procedure expose filespec
sayif arg( 1 ) = "FileNotFound" then do
say "File not found: "||filespec
endelse do
say "LoCase - convert file names to all lower case"
say "Written by Rob van der Woude"
say "http://www.robvanderwoude.com"
end saysay "Usage: LOCASE <filespec> [ /Subdirectories ]"
exitreturnpage last modified: 2025-10-11; loaded in 0.0073 seconds