TL;DR
You have a few choices:
- Don’t use those programs
- Contact the devs of the programs you use and ask them to store their data in AppData instead of Documents
- Use a secondary account/VM for some programs
- Manually clean up the folder periodically
- Use/write a program/script to periodically clean up the folder using blacklists and/or whitelists
- (As a not-ideal hack, you could always just create empty files with the same names as the unwanted directories and set them to +R+A+S+H. That way, the program will be unable to create the directory or put anything in it—though you will still have a bunch of 0-byte files.)
- Create subdirectory in Documents to store your “actual files” and use that as your document root (this is easier if you redirect the subdirectories for Video, Pictures, etc. to the new folder as well)
- Similar to the previous point, but abandon the Documents folder to programs altogether and use a different folder for your “actual files”, e.g.,
C:\Users\Muntoo\MyActualFiles\*
(don’t forget to redirect Videos, Music, Favorites…)
Foundation
Under Windows, every user gets a directory where their user-specific files are stored. It can be accessed with the variable %userprofile%
. In Vista and up, this is under the \Users\
folder and in XP and down, it is in the \Documents and Settings\
folder.
Now once you enter a user-directory, it breaks down into a few different purpose-specific subdirectories. (Often, there will be other files and folders in the root of the user-directory, but officially, there are only supposed to be a few predefined ones, and programs and users are supposed to place items in one of the appropriate subdirectories.)
There are two main branches of the user-directory: one where user-generated files
are saved, and one where program-generated settings
are stored.
Vista and up use the generic folder name Users
because it has no spaces, but in XP and down, the name Documents and Settings
makes its purpose much more obvious: it stores (user) Documents and (program) Settings.
Application
When you run a program and configure it, the program will store the customised settings in the Application Data folder in %userprofile%
(it has different names depending on the version of Windows). It comes in two versions: one where the files are stored on that specific system (“local”) and one where the files are copied to a server so that your settings can move to different systems on the network with you (“roaming”). (Since Vista, there are also low-privilege variations.)
When you save a file, you save it to your My Documents folder in %userprofile%
(the specific folder name varies by Windows version). This folder (by default) has various subdirectories for each media type (text, pictures, music, videos, etc.)
Example
As an example, imagine that a user named Foobar runs a program called CoolApp in Windows 7 installed on the C drive:
- Their user-directory is
C:\Users\Foobar\
- When they configure CoolApp, it stores the settings in
C:\Users\Foobar\AppData\Local\CoolApp\
- CoolApp may also/instead store some settings/files in
C:\Users\Foobar\AppData\Roaming\CoolApp\
- When they create a file in CoolApp, they save it to
C:\Users\Foobar\My Documents\
Note, that the My Documents folder is the default for saving files, but obviously, the user is free to save any directory that they have permissions to.
Advice
Separating user documents and program settings is useful because it makes file management easier. Almost every program will store files in the application-data folder, even if it was used only once and never again. In fact, separating all user-data from the operating system is advisable because it makes it much easier and faster to backup and restore the OS and/or user-data and also results in smaller backups.
Methodology
There are two official ways to change the My Documents location.
You can change (and physically move) the My Documents folder automatically by opening the Properties dialogue for it and changing the target directory.
In Vista and up:
In XP and down:
You can also move it manually by editing the Personal value in the registry key
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
You need not edit the corresponding value in …\Explorer\Shell Folders
. You need to reboot or restart Explorer for Windows to pick up the change anyway, and when you do, Explorer will update the value in Shell Folders
from the one in User Shell Folders
.
You will need to manually move the actual folder to the new location.
While you’re at it, you may as well move the other folders such as My Pictures, My Videos, Favorites, etc.
Miscellaneous
When you save a game, you are essentially saving a file just like saving a document in Word or a picture in MSPaint. As such, savegames are usually stored in the My Documents now, but some save them in the Application Data folder with the game's settings.
I gave up and just store my files elsewhere. The root cause is too many developers misuse "My Documents" to store program data. Configuring Windows won't do anything. – kevin – 2018-07-11T02:49:51.323
1You can change the registry entries that point to the folder to point to somewhere else. – Synetech – 2012-06-04T02:19:12.107
It's a little had to understand what your problem is. Can you elaborate more on what is happening and what you want to happen? – Scott Chamberlain – 2012-06-04T02:20:17.393
2http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem . What problem are you actually trying to solve? – ChimneyImp – 2012-06-04T02:24:09.660
7The problem that he is having is that his 'My Documents' folder is filled with folders that applications create. such as settings, savegames (for games of course), etc. It is indeed a very big problem. Just go to your 'My Documents' and see it for yourself. – MasterMastic – 2012-06-04T02:28:59.137
On a side note
Applications: put all your stuff here
Is also known as%AppData%
and%LocalAppData%
try typing either of those in to the address bar of explorer and see where it takes you. – Scott Chamberlain – 2012-06-04T02:33:49.560@Ken, I don’t see what the “very big problem” is. That is where your application-settings, saved games, pictures, etc. are supposed to be stored. – Synetech – 2012-06-04T02:46:35.333
@Synetech Perhaps for a user that doesn't use documents so much. Personally I do, and when I want to save/load documents, I have to go to an incredible messy folder and search between many files and folders what I'm looking for (not pleasant as you can imagine). Not to mention how the save/open file dialog takes his time to load the files. – MasterMastic – 2012-06-04T02:50:10.593
Muntoo, can you please indicate the exact path that you are talking about? For example, is it
C:\Users\Muntoo\
,C:\Users\Muntoo\Documents
,C:\Users\Muntoo\AppData
, etc.? – Synetech – 2012-06-06T15:46:08.9401@Synetech
C:\Users\Muntoo\Documents
. – Mateen Ulhaq – 2012-06-07T23:12:03.440@muntoo, what exactly is in there that’s a problem? I just examine my “dirtiest” Documents folder and there is nothing that bad in there. Aside from things I want and expect to be in there, there are some logs and a few settings. If you have that many misbehaving programs, then you may want to use a separate account for testing programs so that you can nuke the whole thing every now and then. – Synetech – 2012-06-08T00:39:23.470
1
@Synetech On my Vista, there's a big disparity between My Documents and My Actual Files.
– Mateen Ulhaq – 2012-06-08T02:22:17.303