(view source code of upcase.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 */
parse upper arg filespec dummy"/"option
if 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 SysLoadFuncs
end
call 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 ) )
say "1B"X||"[1;1H"||"1B"X||"[K"||newname||"0D0A"X||"1B"X||"[K"||"1B"X||"[1A"
address CMD "@CMD /C REN "||file.i||" "||newname
end
EXIT
Syntax: procedure expose filespec
say
if arg( 1 ) = "FileNotFound" then do
say "File not found: "||filespec
end
else do
say "UpCase - convert file names to all uppercase"
say "Written by Rob van der Woude"
say "http://www.robvanderwoude.com"
end
say
say "Usage: UPCASE <filespec> [ /Subdirectories ]"
exit
return
page last modified: 2024-04-16; loaded in 0.0055 seconds