Here is a small tool to call functions exported by Dlls. To pass numerical arguments, use a leading @ symbol. The environment variable %ERRORLEVEL% stores the value returned by the function called with CallDllFunc.exe :
Usage :
CallDllFunc.exe dllfile.dll function params
A quick example :
Set MB_ICONEXCLAMATION=48
Set MessageBox=MessageBoxA
CallDllFunc.exe msvcrt.dll printf "This is %%s %%u" test @1
CallDllFunc.exe user32.dll %MessageBox% @0 "Message 1" Caption @%MB_ICONEXCLAMATION%
CallDllFunc.exe testdll.dll add @80 @20
CallDllFunc.exe msvcrt.dll printf " 80 + 20 = %%u" @%ERRORLEVEL%
@echo.