欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

將txt文件名寫入文件首行的bat代碼(保留源文件)

 更新時(shí)間:2014年05月22日 11:55:18   作者:  
這篇文章為大家分享了將txt文件名寫入文件首行的bat代碼并且保留源文件,方便整理一些txt文檔

復(fù)制代碼 代碼如下:

@echo off&color 0f&setlocal enabledelayedexpansion
echo.
echo.
echo.
set "m=0"
set/p m=                      初始值=?
echo.
set "x=1"
set/p x=                      遞增值=?
echo.
set "y=2"
set/p y=                      有效值=?
echo.
set/p=是否要清空以前的重命名清單[?]輸入Y清空,其它任意值保留。<nul
for /l %%1 in (1,1,29) do set/p=<nul
set/p del=
if /i "%del%" equ "y" cd.>list.txt
for /f "delims=" %%i in ('dir /b *.txt') do (
if /i not "%%~nxi" == "list.txt" (
set /a "m+=%x%"&set "n=00000!m!"&set "n=!n:~-%y%!"
echo %%~ni >old.txt
copy /b old.txt + "%%~nxi" !n!.txt>nul&echo+!n!.%%~ni>>list.txt
rem 如果要?jiǎng)h除原文件的話就把下面這一句前面的“rem ”刪掉。
rem del /q /f "%%~nxi"
))
del old.txt

直接運(yùn)行bat回車就可以了,如果有特殊需求可以輸出初始值等信息

相關(guān)文章

最新評(píng)論