The Move Method of the ODAX ActiveX Object moves the specified source filename to the destination filename.
Move (Method of the ODAX ActiveX Object) Syntax var status = object.Move(srcFileName, destFileName);
Parameters
Items listed in this section indicate parameters, or attributes which can be set.
Name Possible Values Description
Default Value srcFileName String Source file name with full path which needs to be moved N/A destFileName String Destination file name with full path where the file will be moved N/A
Return Values
Name Description Status Returns 0 if no error occurs or an error code if an error occurs. (Please Refer to GetLastErrorString for More Detail)
Examples
The following javascript displays how to move a file:
<script> var ax = new ActiveXObject("CeODAX.ODAX"); var srcFileName = '\\application\\test.xml'; var destFileName = '\\windows\\test.xml'; var status = ax.Move(srcFileName, destFileName); </script>
Copy example to clipboard
Remarks
GeneralIt's good practice to check if the file exists before moving it. To do this use the FileExists() method which will support any file extension. If the destination folder has a file with the same name and extension then the operation will result in a failure.
Additional Information
Supported Platforms Windows Mobile, Windows CE Persistence Runs immediately. Min. Requirements None.