Microsoft KB Archive/328607

= Roaming Profile Accumulates Extra .tmp Files =

Article ID: 328607

Article Last Modified on 2/28/2007

-

APPLIES TO


 * Microsoft Windows XP Professional
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server

-



This article was previously published under Q328607



SYMPTOMS
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:

Time:

User: S-1-5-21- - - -

Computer:

Description:

Windows cannot copy file \\ \ \...\Prf???.tmp to location R:\Documents and Settings\...\Prf???.tmp. Contact your network administrator.

DETAIL - Cannot create a file when that file already exists.



CAUSE
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.



RESOLUTION
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.

-or-
 * 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.



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



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 &quot;Userenv Logging Information&quot; topic in this article for additional information.
 * 1) When you log off, any remaining Prf*.tmp files are automatically uploaded with the profile.
 * 2) 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 &quot;Symptoms&quot; 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. 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  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  to   with error = 32



NOTE: Error 32 is defined as follows:

ERROR_SHARING_VIOLATION

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

Keywords: kbprb KB328607

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.