|
Answer» Hi! I have problem with my code: @echo off for /f "tokens=*" %%I in ('dir /B /s /a-d "C:\bat"') do ( set /p CHOICE="%%~nI" echo. echo file %choice% echo. SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION SET J=-1 SET T="%%~nI" :STRLEN_LOOP SET /A J += 1 IF NOT "!T!" == "" IF NOT "!T!" == "!T:~0,%J%!" ( GOTO :STRLEN_LOOP ) SET /A J -= 2 ENDLOCAL & SET RESULT=%J% echo bukv %result%
) pause
This code FIND files with lenght of file name ==5 in some folder. But For don't WORK here( Program takes just 1 file( from folder( I think where are some problem here: :STRLEN_LOOP SET /A J += 1 IF NOT "!T!" == "" IF NOT "!T!" == "!T:~0,%J%!" ( GOTO :STRLEN_LOOP ) because without it all works perfect... Can SOMEONE help me plz? And sorry for my bad language cos i'm from RUSSIA...
|