CopyFile Method |
Description
Copies one or more files from one location to another.
PowerBASIC Syntax
Arguments
Remarks
Wildcard characters can only be used in the last path component of the source argument.
Example [PowerBASIC]
#INCLUDE "windows.inc" #INCLUDE "scrrun.inc"
DIM fso AS IFileSystem
' Create an instance of the FileSystemObject fso = NEWCOM "Scripting.FileSystemObject" ' Copy a file fso.CopyFile UCODE$("C:\MyFolder\Test.txt"), UCODE$("C:\MyFolder\Test2.txt"), %FALSE IF OBJRESULT = %S_OK THEN MSGBOX "File copied" ELSE MSGBOX "Error &H" & HEX$(OBJRESULT) & " copying the file" END IF
|