Friday, October 28, 2005

Programming Skills: Use Batch Command to Change File Names or Extentions

If you want to modify multiple file names or extention names, the batch command below might be helpful:

@echo off echo BEGIN PROCESSING...
for /f "tokens=*" %%a in ('dir /b /s *.txt') do (
echo Current processing file %%a
rename %%a *.dat
)
echo END PROCESSING...


This batch command will change all the *.txt files in current folder and sub-folders to *.dat files.

0 Comments:

Post a Comment

<< Home