@echo off set /p var="Enter the name: " call :F "%path%" "%pathext%" "%var%" pause ::exit /b :F for /f "