here a simple little cli script that has the guts of what youre trying to accomplish. NOTE: this is not a comprehensive solution :) <?php $srcDir = $argv[1]; $destDir = $argv[2]; if(is_dir($srcDir) && is_dir($destDir)) { $dirHandle = opendir($srcDir); while($curFile = readdir($dirHandle)) { if(empty($curFile) || $curFile == '.' || $curFile == '..') { continue; } rename("$srcDir/$curFile", "$destDir/$curFile"); } } ?> -nathan