I keep some folders on my Mac desktop in a specific arrangement that helps my workflow. This problem has happened to me a few times in the past years -- I have the files (icons) arranged the way I like them on the desktop, or in a folder -- then suddenly my Mac rearranges all the icons into some random (to me) arrangement. It's a pain the butt.
Here are some solutions:
The best solution that I have found is below. In perusing various Mac forums, I see solution number 2 being mentioned more commonly -- but it has almost never worked for me. In fact, last night, I tried solution number 2 after arranging my desktop the way I preferred (after it got randomly arranged) -- and deleting the .DS_Store file caused my icons to go into chaos mode again! Talk about wasted work and time.
1. The best solution for me: try resetting finder preferences. Delete the file /users/username/library/preferences/com.apple.finder.plist. then control-option-click on Finder in the dock and choose "relaunch".
2. Trash the hidden .DS_Store file that is in all Mac folders. Here are three ways to do it:
Use the free TinkerTool app. In Finder options - select 1st one - "Show hidden and system files"
Relaunch finder to activate changes. Trash the .DS_Store file on the right top of the screen. Wait a couple of seconds before it rebuilds or relaunch the finder again.
You can show hidden files using Terminal commands, and here are some other suggestions:
--> I found out that using the freeware Onyx it is very easy to delete the desktop's .DS_Store file.
I used "COCKTAIL" and made the invisible files visible. I then deleted only one invisible file named ".ds_store" - restarted - and all icons stay where they're supposed to now
...had the same problem of icons ending up on the right after any restart (in both 10.5 and 10.6), which was resolved by deleting the hidden .DS_Store file on the desktop. It rebuilt itself and the problem went away. YMMV