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