This page is edited from the 1cmdfaq.txt faq-file contained in
mytscmd.zip
command line interface (CLI) collection. That zipped file has much
additional material, including a number of detached .cmd script
files. It is recommended that you also get the zipped version as a
companion.

@echo off & setlocal enableextensions::
set find_=gawk.exe
set found_=
for %%f in ("%find_%") do set found_="%%~$PATH:f"
if exist "%find_%" set found_="%find_%"
if [%found_%]==[""] (
echo "%find_%" not found at path or in the current folder
goto :EOF)::
if not "%~1"=="" goto _calculate
echo Usage: %~0 Expression
goto :EOF::
:_calculate
gawk 'BEGIN{printf"%%s\n",%*}'
endlocal & goto :EOF

A third option is using a third-party program such as FN.EXE from
tsfunc17.zip
(or whatever is the current version number). An example
D:\TEST>fn sin(45*3.1415926536/180) /b
0.7071067812

A fourth option is using QBASIC or GWBASIC, if available. For more
see
FU.BAT Poor man's function evaluator
and the MS-DOS+Win../95/98/ME FAQ
tsbat.zip
item "141. Can I calculate factorials in a batch? Do I need
recursion?" which is sufficiently compatible with NT/2000/XP.

As you can observe the case of trying to return the ANSI character
code corresponding to the first letter in a string produces an error.
However, we can easily write a simple special solution to get the
codes: