试试这个:
BOOL MoveFileEx(
LPCTSTR lpExistingFileName, // pointer to the name of the existing file
LPCTSTR lpNewFileName, // pointer to the new name for the file
DWORD dwFlags // flag that specifies how to move file
);
当lpNewFileName为NULL,且dwFlags为MOVEFILE_DELAY_UNTIL_REBOOT的时候,MoveFileEx将会把lpExistingFileName所指定的文件注册为重启系统以后删除。
我想,这就是你要的效果吧?