VBscript to rename file based on SQL field value
Posted on 2009-05-14
I have image files uploaded to my server with a consistent naming pattern. They all are named based on their unique MLS listing number (these are pictures of homes from realtors). That unique listing number is also present in the sql table along with other fields of data. Each record in the sql table has another unique field value called record number. I want to write a vbscript to convert those file names from their MLS listing number to their record number.
Obviously, I need to have a fso.moveFile oldFileName, newFileName type structure which I can figure out. I'm not sure how to loop the lookup portion of the script which will look for the pictures matching sql record and return the record number. Any help is greatly appreciated.