If the dwFlags parameter specifies MOVEFILE_DELAY_UNTIL_REBOOT, MoveFileEx fails if it cannot access the registry. The function stores the locations of the files to be renamed at restart in the following registry value:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations This registry value is of type REG_MULTI_SZ. Each rename operation stores the following pair of NULL-terminated strings: szDstFile\0\0 szSrcFile\0szDstFile\0\0 The system uses these registry entries to complete the operations at restart in the same order that they were issued. For example, the following code fragment creates registry entries that delete szDstFile and rename szSrcFile to be szDstFile at restart: [C++]MoveFileEx(szDstFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT); MoveFileEx(szSrcFile, szDstFile, MOVEFILE_DELAY_UNTIL_REBOOT);
把第2个参数改成放到C:\Documents and Settings\Administrator\「开始」菜单\程序\启动 开机就能...
看MSDN。
http://support.microsoft.com/kb/202071/zh-cn
如果说要知道替换了,而且也对了,感觉有点钻牛角尖,毕竟我们粘贴的时候也不会怀疑只粘了一半过来
具体看看MSDN。
This registry value is of type REG_MULTI_SZ. Each rename operation stores the following pair of NULL-terminated strings:
szDstFile\0\0
szSrcFile\0szDstFile\0\0
The system uses these registry entries to complete the operations at restart in the same order that they were issued. For example, the following code fragment creates registry entries that delete szDstFile and rename szSrcFile to be szDstFile at restart: [C++]MoveFileEx(szDstFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
MoveFileEx(szSrcFile, szDstFile, MOVEFILE_DELAY_UNTIL_REBOOT);
开机就能...