The Delete Method of the ODAX ActiveX Object deletes the specified file.
Delete (Method of the ODAX ActiveX Object) Syntax var status = object.Delete(fileName);
Parameters
Items listed in this section indicate parameters, or attributes which can be set.
Name Possible Values Description
Default Value FileName String File Name with full path to be deleted N/A
Return Values
Name Description Status Returns 0 if no error or the return value from the windows API call GetLastError() if an error occurs
Examples
<script> var ax = new ActiveXObject("CeODAX.ODAX"); var fileName = '\\application\\test.xml'; var status = ax.Delete(fileName); </script>
Copy example to clipboard
Remarks
GeneralIt's good practice to check if the file exists before deleting it. To do this use the FileExists() method which will support any file extension and will work as per normal delete command.
Additional Information
Supported Platforms Windows Mobile, Windows CE Persistence Runs immediately. Min. Requirements None