代码之家  ›  专栏  ›  技术社区  ›  Hannes de Jager Ruben

movefileex与movefile_delay_直到_reboot对win2008没有影响

  •  0
  • Hannes de Jager Ruben  · 技术社区  · 16 年前

    我在Windows 2008上使用Windows API的movefileex函数,并在尝试将文件C:\A.txt移动到C:\B.txt时使用move file_delay_until_reboot选项。我可以看到,在使用regedit.exe时,根据Microsoft的文档,条目被插入到正确的注册表位置(system\currentcontrolset\control\session manager\allowprotectedrenames),但重新启动后,重命名仍然没有发生。为什么会这样?在Win2008上是否还需要采取其他步骤?

    1 回复  |  直到 16 年前
        1
  •  0
  •   Hannes de Jager Ruben    16 年前

    好吧,结果是窗户把我当成了傻瓜。C:\A.TXT实际上是C:\A.TXT.TXT,由于这个小功能很好,Windows必须“隐藏已知文件类型的文件扩展名”…啊!!

    还要注意,这只在文件位于同一卷上时有效,因为在使用movefile之前,您不能使用movefile_copy_allowed选项。