I will tell you both the methods to do it Manually as well as with MEL
Manual Method:
1. Select all the objects which you want to modify.
2. Go to Window>General Editors>Attribute Spreadsheet.
3. Switch to "Render" tab in there.
4. Now you can turn On to Off for both "Cast Shadows" and "Receive Shadows" option by selected the first column under the name of the attribute(for e.g Cast Shadows) then hold shift and click the last column(vertically) then enter 0(for off) or 1(for on).
Using MEL:
Note: Only select the objects you wish to modify and then run the following script.
Quote:
// Get the selected objects
string $sel[] = `ls -sl`;
// Counter Variable
int $i;
// Use the for Loop to un-check each objects.castsShadows
// objects.receiveShadows.
for($i = 0; $i < size($sel); $i++) {
// Need to get the shapeNode for each object
// as the .castsShadows/.receiveShadows attributes
// are located there
string $shape[] = `listRelatives -shapes $sel[$i]`;
// Set both to zero
setAttr ($shape[0] + ".castsShadows") 0;
setAttr ($shape[0] + ".receiveShadows") 0;
// Clear the $shape array
clear $shape;
}
|
Copy the above script to the script editor then select it and Middle Mouse drag to the shelf so you get a button for it

. To use simply select the objects you want to disable these attributes for and hit the shelf button.