In versions of Mac OS previous to OS X, you rebuilt the desktop to re-create the association between files and their applications. OS X handles the desktop structure more efficiently, which eliminates the need to rebuild the desktop. But, if your Mac still uses OS 9 to run "Classic" applications, you do need to occasionally rebuild the OS 9 desktop. If you're experiencing problems with certain file icons not appearing correctly in Mac OS X, you can try rebuilding the desktop with an AppleScript, but many expert users feel this makes little difference.
Rebuilding the OS 9 Desktop in OS X
Go to the "Apple" menu in the upper left of your screen and select "System Preferences."
Click the "Classic" icon.
Select the middle tab that reads "Advanced." Click "Rebuild Desktop."
Click on the hard drive icon where your operating system is installed and click the "Rebuild" button.
Wait for the rebuilding process to complete. Close the window when it's finished.
Rebuilding the OS X Desktop
Double-click the "Rebuild OSX Desktop 1.0" AppleScript.
Click the "Rebuild" button.
Click the "OK" button.
Go to the "Apple" menu and select "Log Out 'Your User Name.'" Click the "Log Out" button.
Log back into OS X and the process is complete.
After rebuilding your OS X desktop, it's a good idea to run Apple's Disk Utility to repair disk permissions.