File.Move()

JScript3.0+Syntax

							file.Move(destination)

Description

The Move method is used to move a file from one location to another. This method takes a single parameter, destination, which represents the location to which the file is to be moved.

Example

Listing 9.57 shows how the to move a file from one location to another.

Listing 9.57 Example of Move Method
 <html> <body> <script language="JScript"> <!-- Hide // function creates a new file and then moves it from the // C drive to the E drive. function move() { var myObject, f; // Create an instance of the FileSystemObject myObject = new ActiveXObject("Scripting.FileSystemObject"); f = myObject.GetFile("c:\\test.txt"); f.Move("e:\\"); } //--> </script> Move the file test.txt <form ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.