Here is what you need to do, am sure it does work.
1. Close all windows and quit all apps.
2. In Finder, hold down the Option key and click ‘Go’ in the menu bar at the top.
3. Choose ‘Library’ (you have to have the Option key held down to see Library in the menu).
4. Navigate to Library > Preferences > ByHost > com.apple.loginwindow.[xxxxxxxxx].plist
The [xxxxxxxx] represent some interminable string of numbers and letters. Don’t mistake it for the similarly entitled Unix executable file. What you need to check is that its ‘loginwindow’ and ‘.plist’ at the end.
5. When you’re sure you’ve identified the right file, select it and press Cmd-i to show the ‘Get Info’ window. Click the ‘Locked’ option.
6. Now, test that it works. Close the ‘Get info’ window and the finder window. Open up Safari, Preview and a couple of windows. Do a restart and behold — if you followed the instructions correctly — a clean desktop!