windows - The Directory name is too long in batch -



windows - The Directory name is too long in batch -

i trying create programme calculate size of folder nowadays in specified location or current location using batch script , writing .csv file

i followed question in stackoverflow

how list folder size via batch file

and code

`@echo off setlocal disabledelayedexpansion set "folder=%~1" set "value=0" if not defined folder set "folder=%cd%" (for /d %%a in ("%folder%\*") ( set "size=0" /f "tokens=3,5" %%b in ('dir /-c /a /w /s /x "%%~fa\*" ^| findstr /b /c:" "')do if "%%~c"=="" set "size=%%~b" setlocal enabledelayedexpansion echo(%%~nxa , !size! endlocal ))>>foldersize.csv endlocal exit /b`

when run code, getting error

the directory name "dir_name" long

i knew maximum length windows path name 260 character , might reason error.

is there way can solve problem ??

thanks in advance every response.

the way see work, assuming physical server hold info not have problem accessing same folders, map drive letter folder process of directory traversal starts, removing computer address , share name path length.

windows batch-file

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -