• Welcome to Jose's Read Only Forum 2023.
 

IFileSystem.DeleteFile Method

Started by José Roca, July 14, 2008, 03:06:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following example illustrates the use of the DeleteFile method.

JScript


function DeleteAFile(filespec)
{
   var fso;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   fso.DeleteFile(filespec);
}


VBScript


Sub DeleteAFile(filespec)
   Dim fso
   Set fso = CreateObject("Scripting.FileSystemObject")
   fso.DeleteFile(filespec)
End Sub


PowerBASIC


SUB DeleteAFile (BYVAL strFileSpec AS STRING)

   LOCAL fso AS IFileSystem

   fso = NEWCOM ("Scripting.FileSystemObject")
   fso.DeleteFile(UCODE$(strFileSpec))

END SUB