Author Topic: IFileSystem.DeleteFile Method  (Read 2486 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.DeleteFile Method
« on: July 14, 2008, 03:06:53 AM »

The following example illustrates the use of the DeleteFile method.

JScript

Code: [Select]
function DeleteAFile(filespec)
{
   var fso;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   fso.DeleteFile(filespec);
}

VBScript

Code: [Select]
Sub DeleteAFile(filespec)
   Dim fso
   Set fso = CreateObject("Scripting.FileSystemObject")
   fso.DeleteFile(filespec)
End Sub

PowerBASIC

Code: [Select]
SUB DeleteAFile (BYVAL strFileSpec AS STRING)

   LOCAL fso AS IFileSystem

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

END SUB