FileSystemObject.MoveFile()

JScript3.0+Syntax

							filesystemobject.MoveFile(source, destination)

Description

The MoveFile() method is used to move a file from a source to a destination. This method takes two parameters. The first parameter, source, is the location of the file to be moved, while the second parameter, destination, is the new location of the moved file.

Example

Listing 9.92 shows how the MoveFile() method is used. An instance of the FileSystemObject is created and then used to move the test.txt from the root directory on the C drive to the tmp folder.

Listing 9.92 Example of MoveFile()
 <html> <body> <script language="JScript"> <!-- Hide function move() { var myObject; // Create an instance of the FileSystemObject myObject = ...

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.