好像MoveFileEx也OK的,保护的文件就不行了
The MoveFileEx function renames an existing file or directory.
BOOL MoveFileEx(
LPCTSTR lpExistingFileName, // address of name of the existing file
LPCTSTR lpNewFileName, // address of new name for the file
DWORD dwFlags // flag to determine how to move file
);
Parameters
lpExistingFileName
Points to a null-terminated string that names an existing file or directory.
lpNewFileName
Points to a null-terminated string that specifies the new name of lpExistingFileName.
When moving a file, the destination can be on a different file system or drive. If the destination is on another drive, you must set the MOVEFILE_COPY_ALLOWED flag in dwFlags.
When moving a directory, the destination must be on the same drive.
Windows NT:
//Reboot时,替换文件!
If dwFlags specifies MOVEFILE_DELAY_UNTIL_REBOOT, lpNewFileName can be NULL. In this case, MoveFileEx registers the
//可以删除文件的
lpExistingFileName file to be deleted when the system reboots.