MS DOS command to rename files in folder

for /f “delims=” %%i in (‘dir /b /a-d *.txt’) do ren “%%~i” “Prefix%%~niSuffix%%~xi”

This line can be inserted in a batch file (*.bat), it will apply to all files with “txt” extension where the command is run, and will add “Prefix” as prefix, “Suffix” as suffix: you may adapt as needed!

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s