Write a FOR loop such as below
@echo off
for /R “C:\Users\Admin\Desktop” %%I in (*.*) do (
echo %%~nI
)
pause
To modifier the variable I, use the following
%~I Expands %I which removes any surrounding quotation marks (“”).
%~fI Expands %I to a fully qualified path name.
%~dI Expands %I to a drive letter only.
%~pI Expands %I to a path only.
%~nI Expands %I to a file name only.
%~xI Expands %I to a file extension only.
%~sI Expands path to contain short names only.
%~aI Expands %I to the file attributes of file.
%~tI Expands %I to the date and time of file.
%~zI Expands %I to the size of file.