add directory to the filename

how do i add the name of the folder the files are in to the filenames being changed?
Reply to #1:
Hi,
Use the tag <DirName>

Miguel