SQL Server Performance

Mass renaming of files

Discussion in 'SQL Server DTS-Related Questions' started by jaybee, Jun 9, 2008.

  1. jaybee New Member

    Hi all,

    I wanted to get some help with a personal project, with the dual purpose of practicing DTS.

    On one of my drives I've got a master folder (Pictures) containing 56,000 jpg's. The folder is divided by several layers of sub folders, and at the bottom layer, I have a sub-sub-sub(etc) folder containing the jpg's.

    Now, only that lowest layer of subfolder is descriptively titled, ie "Manchester", and thus it will contain pictures of Manchester ! The reason for the renaming is that in most folders, the pictures are unhelpfully titled, "Picture1.jpg", "Picture2.jpg" etc.

    What I'd like is to create a package that renames each picture in a subfolder to that subfolders name, thus "Manchester1.jpg", "Manchester2.jpg" etc. then copies the 56,000 newly-renamed files to a single folder (on the same drive).

    Obviously I'll back up the collection before allowing DTS to begin the renaming.

    Thanks in advance,

  2. MichaelB Member

    You would need to do this using global variables and a vb (activex) script in the package.
  3. jaybee New Member

    Thanks mate!!Jaybee.
  4. MichaelB Member

Share This Page