Update texture paths in many maxfiles

This is a script that updates all texturepaths in an array of maxfiles

IMPORTANT to know... this ONLY works on maxfiles 
SAVED with 3dsmax 2010 or newer.. Older maxfiles 
will just return an empty array...

solution is to open an old maxfile in a new version 
of max, and save it from the newer max

--This is a small function that updates the texture path
fn UpdateTexturePath filename newTexturePath = (
  --Get all fileAssets in a maxfile and store in an array
  fileAssets = getMAXFileAssetMetadata filename

  for fa in fileAssets do ( 

--for every fa get just the filename and filetype..
  fname = (getfilenamefile fa.filename + getfilenametype fa.filename)

--Update the old texturePath with newTexturePath + old filename
  fa.filename = newTexturePath + fname

--this write the information back to the file
setMAXFileAssetMetadata filename fileAssets	

--This is an example when I update the texturePaths 
--on all models in the modelbank

CarDirs = getDirectories "\\\\TheNet\\share-01\\ModelBank\\Cars\\*"
TheNewTextureRoot = "x:\\myTextures\\"

for c = 1 to carDirs.count do (
	carDir = carDirs[c]
	maxFiles = getFiles ("*.max")
	for mxfile in maxfiles do (UpdateTexturePath mxfile TheNewTextureRoot )
	print carDir