Roaming Profile Accumulates Extra .tmp Files


Your roaming profile may accumulate extra files named Prf*.tmp, and the following error message may be logged in the Application event log:

Event Type: Error
Event Source: Userenv
Event Category: None
Event ID: 1000
Date: date
Time: time of day
User: S-1-5-21-#########-##########-##########-####
Computer: Computername
Windows cannot copy file \\servername\share\...\Prf???.tmp to location R:\Documents and Settings\...\Prf???.tmp. Contact your network administrator.
DETAIL - Cannot create a file when that file already exists.


This problem may occur if the Indexing service or some other process (such as an open file agent) has opened the indicated temporary file during profile synchronization. If so, the temporary file is not deleted. It is uploaded with the roaming profile when you log off and reconciled to the local profile when you log on again.

Although antivirus software may also cause this problem, the impact is likely to be minimal because there are fewer file operations for such processes than for Indexing and open file agents.


To work around this problem, use either of the following methods:
  • Turn off the software or the service that is in conflict with the profile engine.

  • Exclude profile folders from the conflicting operational scan or monitor functionality.
Microsoft recommends that you examine any files before you delete them to make sure that they do not contain useful data. The profile engine specifically does not delete littered Prf*.tmp files to prevent potential data loss.


This behavior is by design. Profile reconciliation is specifically intended to error against data loss by retaining temporary files.

More Information

Detailed Description

  1. During profile synchronization and reconciliation, when the profile engine (USERENV) detects that a file in the destination profile is older than its equivalent in the source profile, the source file is copied to a Prf*.tmp file on the target.
  2. The old destination file is deleted, and the Prf*.tmp file is appropriately renamed.

    Note that the temporary file names are generated by the Windows File I/O GetTempFileName API function. If another process opens the temporary file before the temporary file is deleted, and it does not close it, the file is not deleted. Event messages are not logged in the Application event log when this behavior occurs. See the "Userenv Logging Information" topic in this article for additional information.
  3. When you log off, any remaining Prf*.tmp files are automatically uploaded with the profile.
  4. When you log on the next time, file creation errors occur during profile reconciliation if any temporary file names are reused. This condition results in the Userenv event ID 1000 message that is described in the "Symptoms" section of this article.

Userenv Logging Information

The following Prf*.tmp files may not be deleted:
  • Microsoft Windows NT 4.0 system policy files (these files will always be in the profile root directory).

    If you notice that these files are not deleted, it means that the temporary file was not deleted; it does not mean that the policy was not applied. In this scenario, the following data is logged in the Userenv log:
    USERENV() hh:mm:ss:nnn ApplySystemPolicy: Failed to delete policy file PRF###.TMP. Error 32
  • Standard profile temporary staging files (these files will never be in the profile root directory).

    If the existing destination file cannot be deleted, the Prf*.tmp file also cannot be deleted. This behavior may occur if another process has both files open. In this case, no delete retry attempt is made against the Prf*.tmp file. As a result, you will have an outdated local copy of the file (and the most recent copy in the temporary file). In this scenario, the following data is logged in the Userenv log:

    USERENV() hh:mm:ss:nnn ReconcileFile: Failed to delete file filename with error = 32
    In some cases, the existing destination file has been deleted as a normal precursor to renaming the temporary file, but the Prf*.tmp file could not be renamed. In this case, the temporary files are intentionally not deleted to prevent data loss. The following data is logged in the Userenv log:
    USERENV() hh:mm:ss:nnn ReconcileFile: Failed to rename file PRF###.TMP to filename with error = 32
NOTE: Error 32 is defined as follows:

The process cannot access the file because it is being used by another process.

Article ID: 328607 - Last Review: Oct 21, 2008 - Revision: 1