Number of files in a directory
问题 I'm try to find, in only one row, the number of files (*.rar) in a directory. For doing this I'm using the commands: for /f "delims=" %i in ('find /c ".rar" "D:\backup e ckpdb ept-icd\test\unload\lista_files_rar.txt"') do echo %i but the value of %i I have at the end is : D:\BACKUP E CKPDB EPT-ICD\TEST\UNLOAD\LISTA_FILES_RAR.TXT: 8 I would like to obtain only the number 8 so instead to echo the value I would assign the value to a variable. I use the command line : dir /b *.rar | find /c ".rar