Tell your file manager to show hidden files and you’ll see quite a few junk files scattered across your folders. Windows creates thumbs.db and desktop.ini files in many folders, and Mac OS X creates .DS_Store files.
Most people won’t normally see these files. They’re normally considered hidden files and only appear if you go out of your way to show hidden files. The system creates these files to speed things up and save settings for the future, but you can prevent some of them from being created.
What is thumbs.db?
A thumbs.db file is essentially a “thumbnail database” — that’s what the name implies. Whenever you open a folder in Windows Explorer or File Explorer and that folder contains images, Windows will create thumbnails of those images. To speed things up in the future, Windows will save those thumbnail images into a “thumbs.db” file it creates in that specific folder. Windows can then reload those thumbnail images rather than generating them again the next time you open a folder.
This is normally fine, and you won’t normally even notice them because they’re hidden files. However, they can cause issues in some situations. If you upload directories to a web server, for example, the thumbs.db files may tag along.
To prevent Windows from creating thumbs.db files — most people won’t need to do this, but you can if you want — you can either use the Group Policy Editor (on a Professional or Enterprise version of Windows) or the Registry Editor (on a Home edition of Windows.)
To change this setting in Group Policy, press Windows Key + R to open the Run dialog, type “gpedit.msc” into the dialog, and press Enter.
Navigate to User Configuration > Administrative Templates > Windows Components > File Explorer on Windows 10, 8.1, or 8. On Windows 7, navigate to User Configuration > Administrative Templates > Windows Components > Windows Explorer instead.
Double-click the “Turn off the caching of thumbnails in hidden thumbs.db files” option and set it to “Enabled”.
On Home editions of Windows, open the Registry Editor by pressing Windows Key + R, typing “regedit”, and pressing Enter.
Navigate to “HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersion ExplorerAdvanced”. Double-click the “DisableThumbnailCache” setting in the right pane and set it to “1”. If you don’t see the “DisableThumbnailCache” option, right-click in the right pane, create a new DWORD value, and name it “DisableThumbnailCache”. Then, change its value to 1.
Delete the value or set it to “0” to undo this change.
What is desktop.ini?
Windows also creates desktop.ini files, but these are extra-hidden. Not only are they hidden files, but they’re also considered protected operating system files. You won’t be able to see them unless you disable the “Hide Protected Operating System Files (Recommended)” setting in File Explorer or Windows Explorer. This setting is located in the Folder Options window.
Windows uses these desktop.ini files to identify the way a folder should be displayed. For example, when you try to move some folders in Windows, Windows will inform you that the folder is a system folder and you shouldn’t move it. Some folders also have their own unique icons. This sort of information is stored in the desktop.ini file in a folder.
We’re not aware of any way to prevent Windows from creating these files. You should just tell Windows not to display protected operating system files if you don’t want to see them.
What is .DS_Store?
Mac OS X creates .DS_Store files. These files are created in each folder and work similarly to the desktop.ini files on Windows. These files start with a period — a “.” character — and thus are hidden by default on Mac OS X and other Unix operating systems. You won’t see these files on a Mac unless you go out of your way to view hidden files. They won’t normally appear in the Finder or other utilities.
The .DS_Store file contains information about the position of icons in a folder, the folder’s background image, and other details. When you open a folder in the Finder, the Finder reads this file to see how to display the contents of the folder. When you change these settings, the Finder stores those settings in the .DS_Store file.
Macs will normally create these .DS_Store files even on shared network folders, and this could be a problem. For example, those .DS_Store files would just be additional clutter that would confuse Windows users.
To prevent this from happening, Mac OS X offers a way to prevent these .DS_Store files from being created — but only on network drives. To do this, open a Terminal window (press Command+Space, type “Terminal”, and press Enter or navigate to Applications > Utilities > Terminal). Type the following command into the terminal window and press Enter:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
To undo your change and have Mac OS X continue creating .DS_Store files on network drives, run the following command:
defaults write com.apple.desktopservices DSDontWriteNetworkStores false
There’s no way to prevent Mac OS X from creating .DS_Store files locally without third-party hacks. However, leave hidden files disabled in the Finder and you won’t see and be bothered by them.
These files can get in the way when using some programs — for example, version-control programs or file-uploading tools. Ideally, the programs you use should automatically ignore thumbs.db, desktop.ini, and .DS_Store files. If they’re getting in the way in a particular program, see if you can have that program ignore them entirely.