本帖最后由 keshun 于 2023-6-8 16:22 编辑
- @echo off
- setlocal enabledelayedexpansion
- set /p "file=将abc.txt更改为:.txt"
- echo 将abc.txt更改为:%file%
- echo.
- set "filename=%file:~0,-4%"
- set "extension=%file:~-4%"
- set /p "inputText=将abc.txt更改为:%filename% (光标位置,在此输入)"
- set "outputText="
- for %%n in (!inputText!) do (
- set "outputText=!outputText!%%n "
- echo %extension% !outputText:~0,-1!|more /p
- echo \b\b!outputText:~0,-1!|more /p>nul
- )
复制代码 回复 5# meiszp |