开发者

MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT have no effect on Win2008

开发者 https://www.devze.com 2022-12-21 01:16 出处:网络
I\'m using the MoveFileEx function of the Windows 开发者_如何学CAPI 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 usin

I'm using the MoveFileEx function of the Windows 开发者_如何学CAPI 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消