Author Topic: IFileSystem.CopyFile Method  (Read 2786 times)

0 Members and 1 Guest are viewing this topic.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2524
  • User-Rate: +209/-0
  • Gender: Male
IFileSystem.CopyFile Method
« on: July 14, 2008, 03:25:00 AM »

You can use:

JScript

Code: [Select]
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
fso.CopyFile ("c:\\mydocuments\\letters\\*.doc", "c:\\tempfolder\\")

VBScript

Code: [Select]
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "c:\mydocuments\letters\*.doc", "c:\tempfolder\"

PowerBASIC

Code: [Select]
LOCAL fso AS IFileSystem
fso = NEWCOM ("Scripting.FileSystemObject")
fso.CopyFile UCODE$("c:\mydocuments\letters\*.doc"), UCODE$("c:\tempfolder\"), %VARIANT_TRUE

But you cannot use:

JScript

Code: [Select]
var fso;
fso = new ActiveXObject("Scripting.FileSystemObject");
fso.CopyFile ("c:\\mydocuments\\*\\R1???97.xls", "c:\\tempfolder")

VBScript

Code: [Select]
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
FileSystemObject.CopyFile "c:\mydocuments\*\R1???97.xls", "c:\tempfolder"

PowerBASIC

Code: [Select]
LOCAL fso AS IFileSystem
fso = NEWCOM ("Scripting.FileSystemObject")
fso.CopyFile UCODE$("c:\mydocuments\*\R1???97.xls"), UCODE$("c:\tempfolder\"), %VARIANT_TRUE