MoveFile

  BOOL MoveFile(lpszExisting, lpszNew)    
  LPTSTR lpszExisting; /* name of the existing file */
  LPTSTR lpszNew; /* new name for the file */

The MoveFile function renames an existing file.

Parameters

lpszExisting

Points to a null-terminated string that names an existing file.

lpszNew

Points to a null-terminated string that specifies the new name for the file. The new name must not already exist. The new file may be on a different file system or drive.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

Comments

The MoveFile function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).

See Also

CopyFile