Find the Help You Need!


Google
 

Friday, August 15, 2008

Word's Temp Files

I see a lot of comments asking, "why does Word create temp files?" or, "what are those hidden files with the little ~$ in front of them?" I'll answer both of those questions with a quick and dirty explanation of how Word works and why those temp file are important.

Document Files

First of all, we all know what document files are. Those are the "finished products" that we work on - .doc files. We pass these around, print them out, change them, etc. Well, from Word's point of view (as it is with many applications), these are only the finished products, not what you actively work on.

Owner Files

Owner files are those little files that start with ~$ and have the name of the document. They are hidden files (for Word's eyes only). They are not copies of the document and you don't lose anything if you delete them. In fact, with Word closed, you should not ever find any. If you do, that means that Word didn't shut down properly. You're okay to close all instances of Word, and search your hard drive (including hidden files) and delete any ~$ files you find.

If you'd like to know what they contain, you can try opening one. It's just binary code (as is the Word document format). But, you'll likely see a little bit of text like your name, and the company name listed in Word's properties dialog (File > Properties). There's other data too that includes a date and time, etc.

The big purpose for these files is for Word to know who owns a file ("owner" file... get it?). If Word finds one of these (always in the same place as the document file), then Word reads it to find out who's got it open and can then give you that handy dandy read only dialog that we all love.

Working Files

Working files is a bit more complicated. But then again, not. Working files are copies of you document files. They are the files that you're currently making changes to. When you "save" a document in Word, it commits these changes to these ~wrl...tmp files and your document file. Just watching Word do this in the background can be mind numbing and confusing. My advice: don't try: just ignore it and trust that Word will do the right thing.

The good thing about these files is that they can be used to recover lost documents. Say you're working, you just hit save and your power goes out. Power comes back on and you can't find your original document file - it's not where you left it! No problem! In the folder where you saved your document and you should find some ~wrl...tmp files (these are hidden). Just change the extensions from .tmp to .doc and try to open them in Word. You should at least get some of your work back. Save it as a new .doc file and keep on working!

Other Files

Now, there are other files like .asd files. They're autorecover files and we've covered them elsewhere. The big thing here is to understand that Word must use these files to work properly (for example, on a network) and the .doc is not the most important file to Word. Clearly, we care about .doc's, but Word needs more than that to do it's thing for you.

Clean up!

So, here's what you can do if you're really interested in cleaning out these files (a good practice).

  1. Close Word and Outlook (if you use Word as your email editor)
  2. Search your computer (including hidden files and folders) for files with the following name:
    ~*.tmp
  3. Delete all files found (with confidence!)
For more "official" information see a great article written by a friend of mine on how Word creates and uses temp files.

16 comments:

Anonymous said...

Hello, I came across your article while searching for someone who may have the same problem I do. I just found 88 hidden (tilde symbol) WRL#### files going back 2 years, taking up 1GIG of room! No wonder my computer was running slow! (I have a small hard drive)My question is, each one of these files had a FIREFOX icon, and I never did any such program association. How could this happen? Why were they storing themselves for so long? Is it a virus? Thanks for your help.

Dave said...

Word will leave those temp files laying around if it's unable to delete them (i.e., can't shut down normally, doesn't have permissions to the folders, the files are in use by another app (like antivirus scanning them), etc.). So, having them around doesn't necessarily mean that you have a virus or that your computer is about to die.

However, these left-over files might be indicative of a problem with digital dust bunnies. Windows is like a snowball: it keeps picking up more "snow" (e.g. junk) the longer you use it. So, every now and again you have to clean it up using tools, or by reinstalling the OS (my favorite way to troubleshoot Windows problems; I do it 1-2 times per year). You might want to go through the "How to clean word" article (http://howtotroubleshoot.blogspot.com/2007/08/how-to-clean-word.html) to make sure that Word's working okay. Beyond that, you might want to look at this article: http://howtotroubleshoot.blogspot.com/2008/05/making-windows-run-like-newer.html

As far as the Firefox icon association goes, I'm just as confused as you are. I've seen weird temp file associations like that. Since applications can change those associations, it's possible that one just changed it incorrectly. I wouldn't worry about a virus.

Anonymous said...

Hi, very informative article, thank you. You sound like the poerson that could answer the following query related to Word temp files. When you open - and later save - a Word document, temp copies of your document are created and deleted. Is there a way to have these temp files erased, rather than deleted by Word, so that they do not become embedded in cluster file slack of subsequent files? Or is the only option to erase unused space including file slack of the whole drive? Thanks from Paranoid.

Dave said...

Paranoid:
wow, now there's a question that I haven't considered before. Honestly, I don't think that I can give you a definitive answer. Is the issue over the fact that Word is deleting the files, or how Word is deleting the files?

What I can tell you is that Word's temp file creation/deletion is a core feature built into the application itself and there is no option that I'm aware of to change behavior that's this low level. So, you can't turn it off or tweak how it's done. To possibly further complicate the issue, you also can't delete the files while Word is open because they're locked (unless you use some 3rd party utility - but that will impact Word's stability and you'll likely lose data). Does that help, or at least shed some light on the issue?

Anonymous said...

Hello Dave,

A question on the ~$ owner files. When I open a word doc, word creates a file with ~$ as the first two letters. If the doc is saved on desktop the ~$ file appears on the desktop. When you close it it dissappears. Is there a setting to stop that from popping up on the desktop? It never did it before but has started now. Properties show it as hidden. I would like to stop it from popping up where i can see it.
Thank You!

Dave said...

Ah, excellent question. Well, there is no way to turn this "feature" off. However, the files are normally hidden. So if you turn off the "show hidden files and folders" setting in your Folder Options, then you won't see them anymore. Go to:
1. Open any folder, like My Documents
2. Click Tools > Folder Options
3. Under Advanced Settings, put the bullet in "Do not show files and folders"
4. Click OK

Anonymous said...

Hello again Dave,

Re:~$xxx.doc (owner files)

Thank you very much for answering my question. I am kind of embarrased that it is that easy. I never thought about simply just "not showing" the hidden files. I will try this tonight, Thank You very much!

Dave said...

You're welcome!

jacksom said...

Hi Dave,

It is really a good article that you have posted.
I have a question :

I have a file server which has the restriction not delete files but they can modify word files.

After every file is open, it creates temp file in the respective folder.

Can you give a solution to redirect it to the recycle bin as delete option is not there or anything that can reduce the administrative work of deleting these temp file (~$ & .tmp file) ??

Dave said...

Well, this temp file process is completely automagic and hardwired into Word. Sooo... you can't change it.

I assume there's a good reason why your users can't delete files. But, can you set the permission to only delete files for which they're an owner? I'm not administrator, so I usually have to deflect administrative questions back at people ;)

Amrit said...

Hi Dave these are some very good points. But I am have a wired situation going on in network; my Windows 2003 file server. User's accessing any word or excel files on the network share and try to make changes/modify to these files they noticed that lot of TMP files are being created. like xls.~RF8645.TMP & same with word documents. I have also verified their perimissions and they have modify rights assign to the folder as well at file level. Any clue or sugguestion why this is happening?

Dave said...

Amrit:
The .tmp files are just artifacts of Word's processing. Some of them are related to simply using the clipboard (copying and pasting). If users are not showing "hidden files and folders" then they'll never see them. These files are harmless and should go away when Word is closed. If not, then we've got a permissions issue on the folder on the server.

Amrit said...

Dave I have checked the permissions and users have modify rights on the files which is they have the ability to delete files.we're using McAfee as our anti-virus with most updated version of virusscan 8.7i with hotfix 2 and are upto date with windows updates. Just an FYI I also opened a ticket with MS and reproduced the issue and showed them as well. They can't even figure it out.

hewgdragon said...

if Word is closed and Outlook is closed, what else is running that is holding a ~WRL####.tmp file there, I can't delete it and I can't move the folder it is in, which is the genesis of the problem...why does word suck so much @$$!?!?

Dave said...

hewgdragon:
It's possible that the Word process (winword.exe) didn't fully close, or that it's held by your antivirus, or that you don't have permissions to move or delete the file or folder. I'd try a simple reboot first, and failing that look into Unlocker (http://ccollomb.free.fr/unlocker/).

Alex said...

Couple days before I was in complicated situation with my word files. But a friend advised me a tool, which saved me and I hope would be usable for other questions not less - repair .docx document.