Article ID: 202071 - Last Review: November 21, 2006 - Revision: 4.1 PRB: Troubleshooting MoveFileEx() MOVEFILE_DELAY_UNTIL_REBOOT
This article was previously published under Q202071 SYMPTOMS
When you call MoveFileEx() with the MOVEFILE_DELAY_UNTIL_REBOOT flag, sometimes the system might not rename the specified file or directory successfully at restart.
RESOLUTION
To troubleshoot this problem, first check whether the location of the file or directory to be renamed is stored in the following registry value after the MoveFileEx() call:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
If the destination file or directory already exists and has to be replaced, the MOVEFILE_REPLACE_EXISTING flag also needs to be specified along with the MOVEFILE_DELAY_UNTIL_REBOOT flag when MoveFileEx() is called. Otherwise, the move operation fails without any error message when the system is restarted. If the source file or directory is on an NTFS drive, the LocalSystem account or Administrators needs to have delete access permission on the source for the move operation to succeed. If all these conditions are met, the system will move the source file or directory successfully at restart when the session manager is initialized. | Other Resources Other Support Sites
CommunityArticle Translations |





















Back to the top