To change the name of an object in MEL scripting, you can use the command “rename” followed by two strings.
The first string is the object name, and the second string is the name-to-

for example…

rename "nurbsSphere1" "NewName77";

If you want to rename many objects, you may want to make an array and
loop thru the objects.  This script requires the user to select what objects he/she wishes to rename, then run the code:

string $allObjs[] = `ls-sl`;
for($x=0;$x<size($allObjs);$x++) {
rename $allObjs[$x] ("NewName" + $x);

Remember, Maya requires names to be unique.  If similar name strings are desired for multiple objects, users should look into “namespaces.”