- @echo off &setlocal enabledelayedexpansion
- if not exist "1.txt" echo 文件不存在&goto :none
- for /f "tokens=2 delims=<>" %%i in ('find "<NICKNAMESTR_STR>" "1.txt"') do (
- if "%%i" equ "/NICKNAMESTR_STR" (echo 文件中无内容&goto :none
- ) else (
- echo %%i >> %%i.txt
- )
- )
- exit
-
- :none
- set /p n=请输入姓名: &echo !n!>>!n!.txt&&exit
复制代码
|