There is a batch file for outputting all files with the requested extension and name, but my error displays only the first file, and when output, it writes a syntax error
@echo off echo Output file name and characteristics if "%1"=="" ( echo Do not specify the 1st parameter echo Input /? to output help pause goto :EOF ) if "%1"=="/?" ( echo Output file name and characteristics echo 1st parameter - folder name echo 2nd parameter - file type echo Types: echo -text for *.txt echo -command for *.bat echo -all for *.* pause goto exit ) if not exist %1 ( echo Folder is not exist pause goto exit ) if not "%1"=="." ( pushd %1 ) if "%2"=="" ( echo Do not specify the 2nd parameter set /p nam=Input file name: set /p ext=Input file extension: ) else (goto run) if not exist "*.%ext%" ( echo There are not *.%ext% files in this folder pause goto exit ) else (goto user_type) :run if "%2"=="text" ( for %%I in (*.txt) do call :attrib1 "%%I" .txt pause goto exit ) if "%2"=="command" ( for %%I in (*.bat) do call :attrib1 "%%I" .bat pause goto exit ) if "%2"=="all" ( for %%I in ("*.*") do call :attrib1 "%%I" %%~xI pause goto exit ) :user_type for %%I in (%nam%.%ext%) do call :attrib1 "%%I" .%ext% pause goto exit pause goto :exit :attrib1 echo Output file name and characteristics for file %1 attrib %1 echo End exit /b :exit if not "%1"=="." (cd ../)