I keep getting files that I am working on locked for editing. Word only allows me to open them read-only

Article contributed by Terry Farrell

Obsolete Article:  The way Windows Desktop Search operates has changed.  If you are using a modern version of Windows, the techniques described in this article will not work.



This is an indication that some Windows locking files are not being released correctly. This happens everytime your computer crashes whilst Word is running and often for inexplicable reasons. In order to minimise these problems, a good regular clean up of your computer is recommended.

If you are working to a deadline and don't have time for a full cleanup procedure, just follow steps 1-3 below. To thoroughly clean out your system, follow the complete procedure. This will be very similar for all Windows operating systems and versions of Word.

  1. Close all applications and reboot the computer.
  2. Open Windows Explorer and Search for *.tmp, ~*.do?, and ~*.wbk, and delete all that are found (Ctrl+A then press Delete). If you get the message, 'Unable to delete filename', Ctrl+click to deselect that file and press Delete to continue deleting the remainder.
  3. (Notes for power users: you can speed up the Windows explorer Find by concatenating the search criteria using semi-colons or spaces, e.g. *.tmp;~*.do?;~*.wbk; but if you do so, be extremely careful, as a typo could mean you delete some important files! Also, if, for some reason, you have modified the extension for Word Backup files to something other than .wbk, you would need to change your search criteria accordingly).
  4. Go to the Windows/Temp folder and make sure if it is empty. If it isn't empty select and delete the contents.
  5. Reboot your computer again (you may skip this step if you are confident that you have not deleted any system files).
  6. Open the Display Properties dialog (right-click on an empty area of desktop and select Properties) and click on the Screensaver tab. Set Screensaver to none and then select the Power Button. Deselect all power saving options. Close the dialog.
  7. It is advisable to stop any AntiVirus utility running before proceeding with the next stage.
  8. On the Desktop, right-click on the Recycle Bin and select, Empty Recycle Bin.
  9. Open Windows Explorer, right-click on the main drive (usually C:) and select Properties.
  10. Click on Tools tab and then under Error Checking click on Check now. (The exact wording differs slightly between versions of Windows installed).
  11. Make sure that error checking (or ScanDisk) is set to do a Thorough scan of both system and data areas and that Automatically Fix System File Errors is checked.
  12. When the error checking has completed, click on the Defragmentation button and let Windows defrag the drive.
  13. Do the same for any other drives installed.
  14. When complete, reboot the computer; open Word and test that locked file again.

How frequently should you perform this clean up?

This depends if you are a heavy user or a light user. I would recommend that this whole process be performed monthly for a heavy user and approximately 3-monthly for a light user. In between, you may find it necessary to regularly clean out temporary files, say weekly or immediately after a GPF or if you experience a locked file. Performing just steps 1, 2, 3 and 7 will be sufficient for these occasions. Excessive use of Scandisk and Defrag is unnecessary and may cause excessive wear on your computer. Always run a Scandisk before running a Defrag: defragging a drive with errors is a recipe for disaster!

See also Microsoft Knowledge Base article Q211632, which covers how Word uses temporary files.

How Word saves documents

Here is a brief description of how Word saves a file and why you sometimes see that temp file in the documents folder location if you crash.

1.   Create temp file

Create ~wrdxxxx.tmp

2.   Write temp file  

Save example data to ~wrdxxxx.tmp

3.   Delete original file  

Delete Example.doc

4.   Move temp to target name  

Move ~wrdxxxx.tmp to Example.doc 

Word gains significant performance speed by placing the temporary file in the same directory as the saved file. If Word placed the temporary file elsewhere, it would have to use the MS-DOS COPY command to move the temporary file from the other directory to the saved location. By leaving the temporary file in the same directory as the saved document file, Word can use the MS-DOS MOVE command to quickly designate the temporary file as the saved document.

The temp file that is visible in the documents folder when you open a document is the Owner file: (~$FileName.do?). The reason one gets the file in use error is due to the Owner file only. Other temp files will not cause this error. However it is a good idea to use the steps above to clean up, following a crash, to free up space and to prevent possible problems in the future.

The ~wrdxxxx.tmp file, (created during a save) is the one you want if you do need to recover a document from a crash. Almost all of the other temp files are illegible and those that can be read are just bits and pieces of the document - nothing you can really recover from.