PowerBasic Museum 2020-A

Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Windows Script Runtime => Source Code => Scripting => FileSystemObject => Topic started by: José Roca on July 14, 2008, 02:23:59 AM

Title: IFileSystem.MoveFile Method
Post by: José Roca on July 14, 2008, 02:23:59 AM


The following example illustrates the use of the MoveFile method.

JScript


function MoveFile2Desktop(filespec)
{
   var fso;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   fso.MoveFile(filespec, "c:\\windows\\desktop\\");
}


VBScript


Sub MoveFile2Desktop(Drivespec)
   Dim fso
   Set fso = CreateObject("Scripting.FileSystemObject")
   fso.MoveFile Drivespec, "c:\windows\desktop\"
End Sub


PowerBASIC


SUB MoveFile2Desktop (BYVAL strDriveSpec AS STRING)

   LOCAL fso AS IFileSystem
   
   fso = NEWCOM "Scripting.FileSystemObject"
   fso.MoveFile UCODE$(strDriveSpec), UCODE$("c:\windows\desktop\")

END SUB