:: https://www.robvanderwoude.com/batchphp.php :: Returns the largest of the numbers specified :: Usage: "Max 4 16 0 -99" returns "16" @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION IF NOT "%~2"=="" ( FOR %%A IN (%*) DO SET Args=!Args!, %%A PHP -r "print(max(!Args:~2!));" ) ENDLOCAL