[Windows] Move Directory or File

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Windows] Move Directory or File

Post by BackupUser »

Restored from previous forum. Originally posted by wayne1.

Code updated for 5.20+

Code: Select all

; The MoveFile function moves an existing file or a directory, including its children. 
; Return Values
; If the function succeeds, the return value is nonzero.
; If the function fails, the Return value is zero. ;
; Remarks
; The MoveFile function will move (rename) either a file or a directory (including its children) 
; either in the same directory Or across directories. 
; The one caveat is that the MoveFile function will fail on directory moves when the 
; destination is on a different volume. 
 
Result = MoveFile_("C:\MyFiles", "C:\MyOldFiles")