Wednesday, March 25, 2015

Replace all files name inside specific floder

step 1 : open notepad and paste following code

@echo off
setlocal enabledelayedexpansion
for %%j in (*.*) do (
set filename=%%~nj
set filename=!filename:.=_!
set filename=!filename: =_!
if not "!filename!"=="%%~nj" ren "%%j" "!filename!%%~xj"
)

then Save as replacefiles.bat

now copy and paste  replacefiles.bat file inside the specific floder which you want to rename the files. Run  replacefiles.bat file

Note : replacefiles.bat  needs to be executed in the folder containing the files 

Ref : http://www.computing.net/answers/programming/batch-script-to-replace-filenames-h/16301.html

No comments:

Post a Comment