Command Line Rename Files And Append To Front Of Name

Command Line Append:

for /f “tokens=*” %a in (‘dir *.tif /b’) do ren “%a” “LE2_%a”

Command Line Remove:

for %a in (LE2_*.tif) do ren “%a” ”    *.tif”     (note: There are 4 spaces in front of *.tif)
for %a in (    *.tif) do ren “%a” %a     (note: There are 4 spaces in front of *.tif)

In a batch file (replace % with %%):

for /f “tokens=*” %%a in (‘dir*.tif /b’) do ren “%%a” “LE2_%%a”

 

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