首页->【软件工具包使用(Software Tools Usage)】

3 1

批量重命名,以文件夹名与文件名相融合进行重命名。


========================================================

rem  @echo  off
rem ===============================
rem OpenRight
rem  FUNCTION: rename the file by its name and folder name   
rem BATNAME : reneme the files
rem RELEASE Date : 08/01/18
rem Create              :Winyoo_Shiy
rem ================================


rem set the foreground color
color 2
rem set the dir path of rename files
 Set DIR_PATH= C:\Users\Desktop\tester
 rem cd  %DIR_PATH%
 rem get all the files to rename
  for /f  "delims=" %%a in ('dir /a-d/s/b %DIR_PATH%\*.txt') do (
     for  %%b in ("%cd%") do (
     rem now,rename, the argument is string.
     ren "%%~na".txt     "%%~na@%%~nb".txt
     rem for debug
     echo %%~na
     echo %%~nb    
     )  
     )                              
 pause
 rem end of files
 

作者于2018-08-02 20:19:11修改!
楼主可见

  1. shwnyoo 1#

    批量文件重命名例程,一起学习