views:

120

answers:

1

I'm using the MoveFileEx function of the Windows API on Windows 2008 with the MOVEFILE_DELAY_UNTIL_REBOOT option when trying to move a file: C:\a.txt to C:\b.txt. I can see, when using regedit.exe, that the entries are inserted in the correct registry location (System\CurrentControlSet\Control\Session Manager\AllowProtectedRenames) as per Microsoft's Documentation but after a reboot the rename still did not happen. What can be the reason for this? Are there perhaps additional steps to be taken on Win2008?

A: 

Ok, so it turns out that windows caught me for a sucker. C:\a.txt was in fact C:\a.txt.txt due to the nice little feature windows has to 'hide file extentions for known file types'... aaargh!!

Also take note that this only works if the files are on the same volume since you cannot use the MOVEFILE_COPY_ALLOWED option while using MOVEFILE_DELAY_UNTIL_REBOOT.

Hannes de Jager