如果只有这一个文件,批处理如下
echo 文件名为123.txt > temp.txt
type 123.txt >> temp.txt
del 123.txt
ren temp.txt 123.txt
如果你需要将文件名换成参数,也可以这样,比如建立一个叫做sample.bat,内容如下
@echo off
echo 文件名为%1 > temp.txt
type %1 >> temp.txt
del %1
ren temp.txt %1
用的时候用sample.bat 123.txt就行了。