Comp 230 Quiz Week 6
1. Question :
(TCO 6) What WSH object is used for VBScript File I/O?
Student Answer: Scripting.FileSystemObject FileSystemObject Scripting.FileSystem WScript.FileSystemObject
Instructo
...
Comp 230 Quiz Week 6
1. Question :
(TCO 6) What WSH object is used for VBScript File I/O?
Student Answer: Scripting.FileSystemObject FileSystemObject Scripting.FileSystem WScript.FileSystemObject
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 0 of 2
Comments:
Question 2 Question :
.
(TCO 6) What file attribute value in VBScript indicates that the file is ReadOnly?
Student Answer: 0
1
2
4
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 2 of 2
Comments:
Question 3 Question :
.
(TCO 6) To move the file C:\Data\CustData.txt to C:\BackUp\CustData.txt in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) .
Student Answer:
fso.MoveFile(“C:\Data\CustData.txt”,”C:\BackUp\CustData.txt”)
fso.MoveFile(”C:\BackUp\CustData.txt”, “C:\Data\CustData.txt”)
fso.FileMove(“C:\Data\CustData.txt”,”C:\BackUp\CustData.txt”)
fso.FileMove(”C:\BackUp\CustData.txt”, “C:\Data\CustData.txt”)
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 2 of 2
Comments:
Question 4 Question :
.
(TCO 6) To delete a file in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) .
Student Answer: fso.FileDelete(Exists(“C:\Data\CustData.txt”)
fso.DeleteFile(Exists(“C:\Data\CustData.txt”) fso.EraseFile(Exists(“C:\Data\CustData.txt”) fso.FileErase(Exists(“C:\Data\CustData.txt”)
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 2 of 2
Comments:
Question 5 Question :
.
(TCO 6) The following command opens a text file in VBScript.
Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???)
To create a new file if it doesn’t exist, the value of ?? must be .
Student Answer: the value of ?? must be 1 the value of ?? must be 2
the value of ?? must be false the value of ?? must be true
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 2 of 2
Comments:
Question 6 Question :
.
(TCO 6) The following command opens a text file in VBScript.
Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???)
To open a file for writing, the value of ? must be .
Student Answer: the value of ? must be 1 the value of ? must be 2 the value of ? must be true the value of ? must be false
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 2 of 2
Comments:
Question 7 Question :
.
(TCO 6) The following command opens a text file in VBScript.
Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??,
???)
To ensure that the file is formatted as ASCII instead of
Unicode, the value of ??? must be .
Student Answer: the value of ??? must be 0 the value of ??? must be -1 the value of ??? must be 2 the value of ??? must be -2
Instructor Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week
Explanation: 6 Lecture
Points Received: 2 of 2
Comments:
Question 8 Question :
.
(TCO 6) To complete the Read, Write, or Append operation in VBScript, use the following method (assuming fileObj is a file object created with CreateTextFile( ) or OpenTextFile) .
Student Answer: fileObj.Exit fileObj.End fileObj.Next fileObj.Close
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 2 of 2
Comments:
Question 9 Question :
.
(TCO 6) To test to see if a directory (or folder) exists before you write data to it in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) .
Student Answer: If fso.FolderCreated(folderName) Then
If fso.FolderExists(folderName) Then
If fso.FolderNotFound(folderName) Then If fso.FolderFound(folderName) Then
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 2 of 2
Comments:
Question 10 Question :
.
(TCO 6) To delete a folder in VBScript, use the following
command (assuming fso is a Scripting.FileSystemObject) .
Student Answer: fso.FolderDelete(folderName) fso.DeleteFolder(folderName) fso.EraseFolder(folderName ) fso.FolderErase(folderName)
Instructor Explanation:
Instructor Explanation: See Chapter 12, Doc Sharing files, and the Week 6 Lecture
Points Received: 2 of 2
Comments:
[Show More]