The delete function in JavaScript is to delete the specified file or folder.
Object. Delete (force);
Where object is a required option. Should be the name of the File or Folder object.
Force is an optional option. A Boolean value that is True if you want to delete a file or folder that has a read-only property set, otherwise False (default).
And if the specified file or folder does not exist, an error occurs. Http://www.mlybyby.com
The delete function in JavaScript produces the same result as a single File or Folder, and the result of an operation that uses Filesystemobject.deletefile or Filesystemobject.deletefolder.
The Delete method does not differentiate between folders that contain content and that do not contain content. Deleting the specified folder does not consider whether the content is included.
The following example illustrates the use of the Delete method.
var fso, F;
FSO = new ActiveXObject ("Scripting.FileSystemObject");
f = fso. CreateTextFile ("C:\\testfile.txt", true);
F.writeline ("This is a test.");
F.close ();
f = fso. GetFile ("C:\\testfile.txt");
F.delete ();
The delete function in JavaScript