23.9k views
5 votes
In order to move the file C:\Data\CustData.txt to C:\BackUp\CustData.txt in a VBScript program, which of the following command would be used( fso is a Scripting.FileSystemObject).

a. fso.MoveFile("C:\Data\CustData.txt","C:\BackUp\CustData.txt")
b. fso.MoveFile("C:\BackUp\CustData.txt", "C:\Data\CustData.txt")
c. fso.FileMove("C:\Data\CustData.txt","C:\BackUp\CustData.txt")
d. fso.FileMove("C:\BackUp\CustData.txt", "C:\Data\CustData.txt")

User Or Nakash
by
5.9k points

1 Answer

2 votes

Answer:

fso.MoveFile("C:\Data\CustData.txt","C:\BackUp\CustData.txt")

Step-by-step explanation:

Given

Source = C:\Data\CustData.txt

Destination = C:\BackUp\CustData.txt

Required

Code snippet to move file between directories using VScript

First, we need to write out the syntax.

The syntax to implement this is:

fso.MoveFile(Source Path, Destination Path)

The above line of code instructs the system to move the file from its source directory to its destination.

Note that the source path and destination path must include the full directories and the file extensions

In this case, the correct code is:

fso.MoveFile("C:\Data\CustData.txt","C:\BackUp\CustData.txt")

User John Smeuth
by
6.2k points