Have a variable in batch file, how to determine if it contains any characters or how many chrs it contains?
::====== begin batchscript
@echo off & setlocal enabledelayedexpansion
set aa=0
if %1 equ "" goto :ee
set xx=%~1
:xx
set yy=!xx:~%aa%,1!
set /a aa+=1
if "%yy%" neq "" goto :xx
set /a aa-=1
:ee
echo %aa%
::===== end batchscript
or, using vbscript helper:
::==== begin batchscript #2
> len.vbs echo wscript.echo len(wscript.arguments(0))
for /f %%a in ('cscript len.vbs "%~1"') do set len=%%a
::===== end batchscript #2
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |