@ECHO OFF
SETLOCAL
set "ucalphas=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"
set "lcalphas=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"
set "mystring=abcddcbajqz123HELLO teSt"
echo start %mystring%
call :toupper mystring
echo after toupper %mystring%
call :tolower mystring
echo after tolower %mystring%
GOTO :EOF
:toupper
setlocal enabledelayedexpansion
set "result=!%1!"
for %%s in (%ucalphas%) do set "result=!result:%%s=%%s!"
endlocal&set "%1=%result%"
goto :eof
:tolower
setlocal enabledelayedexpansion
set "result=!%1!"
for %%s in (%lcalphas%) do set "result=!result:%%s=%%s!"
endlocal&set "%1=%result%"
goto :eof