VBS-LIKE
VBS-LIKE
VBS-LIKE
NATIVE
@echo off call:LCount %* echo %length% goto:EOF :LCount echo/wsh.echo "set length="^&Len("%*")>..vbs cscript/nologo ..vbs>..bat for %%. in (call del) do %%. ..bat ..vbs goto:EOF
VBS-LIKE
@echo off echo\Input=Inputbox("String:","Input")>..vbs echo\wsh.echo "set length="^&Len(Input)>>..vbs cscript/nologo ..vbs>..bat for %%. in (call del) do %%. ..bat ..vbs echo\%length% pause
VBS-LIKE
@echo off set str=%* echo>len.vbs c=len(wsh.arguments.item(0)):wsh.echo c for /f %%i in ('cscript/nologo len.vbs "%str%"') do set len=%%i echo LENGTH=%len% del len.vbs goto:EOF
NATIVE
Set Str=hello for /f "tokens=1* delims=[]" %%a in (' "%comspec% /u /c echo:%Str%|more|find /n /v """ ') do set /a "length=%%a-4" goto:eof