I would like to receive the following output.
Suppose the directory structure on the file system is like this:
-dir1 -dir2 -file1 -fi
On Windows, you can do it like this as most flexibile solution that allows you to additionally process dir names.
You use FOR /R to recursively execute batch commands.
Check out this batch file.
@echo off
SETLOCAL EnableDelayedExpansion
SET N=0
for /R %%i in (.) do (
SET DIR=%%i
::put anything here, for instance the following code add dir numbers.
SET /A N=!N!+1
echo !N! !DIR!
)
Similary for files you can add pattern as a set instead of dot, in your case
(*.*)