@echo off cd /d "%~dp0" set "InputName=BatHome" set /p "InputName=请输入文件名:" set "FileName=%InputName:~0,7%" type nul >"%FileName%.txt"复制代码