Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set a=1234567890123
- if [%a:~0,-12%]==[] (
- echo a is shorter than 13
- ) else (
- echo %a% is longer than 12
- )
- set a=1234567890123
- if [%a:~0,-12%]==[] (
- echo a is shorter than 13
- ) else (
- echo %a% is longer than 12
- )
- @echo off
- setlocal enabledelayedexpansion
- for /F "tokens=1 delims=" %%i in ('dir /o:-n /b /s') do (
- set filename=%%i
- set part=!filename:~0,260!
- if !filename! NEQ !part! echo !filename!
- )
- @ECHO OFF
- SETLOCAL ENABLEDELAYEDEXPANSION
- set Limit=%~1
- echo Paths being found which exceed !Limit!
- echo ======================================
- type NUL > "!temp!tabulator.txt"
- FOR /F "tokens=1 delims=" %%A IN ('dir /o:-n /b /s') DO (
- set Test=%%A
- call :_cnt_str_len
- echo/!test!
- echo/!_cnt_str_len!
- timeout /t 100
- rem :: call set Test=%%Test:~%Limit%%%.
- IF "!_cnt_str_len!" GEQ "!Limit!" (
- type NUL > "!temp!pathlengthdeterminationtemp.txt"
- echo %%A > "!temp!pathlengthdeterminationtemp.txt"
- FOR /F "tokens=1 delims=" %%H IN ('dir /s /o /b "!temp!pathlengthdeterminationtemp.txt"') DO set StrLen=%%~zH
- del "!temp!pathlengthdeterminationtemp.txt"
- set /a StrLen=!StrLen!-2
- echo !StrLen!,%%A>> "!temp!tabulator.txt"
- )
- )
- sort "!temp!tabulator.txt" /O "!temp!tabulator1.txt"
- del "!temp!tabulator.txt"
- TYPE "!temp!tabulator1.txt"
- del "!temp!tabulator1.txt"
- ENDLOCAL
- goto :_end_of_file
- :_cnt_str_len
- if defined _cnt_str_len set _cnt_str_len=
- for /f %%h in ('cmd /u /c set /p "=%Test:"= %"^<nul^|find /v /c ""') do (
- set _cnt_str_len=%%~h&& call set _cnt_str_len=!_cnt_str_len!
- exit /b
- )
- :_end_of_file
Add Comment
Please, Sign In to add comment