Computer Networking > EXAM > Comp 230 Wk 6 Quiz Devry (All)
Comp 230 Wk 6 Quiz Devry a Question 1 2 / 2 pts (TCO 6) Which line will properly create the object for VBScript File I/O? Correct! Set fso = CreateObject(“Scripting.FileSystemObject”) ... Set fso = CreateObject(“WScript.FileSystemObject”) Set fso = Scripting.FileSystemObject fso = CreateObject(“Scripting.FileSystem”) Question 2 0 / 2 pts (TCO 6) To test to see if a file exists before you overwrite it in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) _____. If fso.FileFound(file) Then If fso.FileCreated(file) Then You Answered If fso.FileNotFound(file) Then Correct Answer If fso.FileExists(file) Then Question 3 2 / 2 pts (TCO 6) To copy the file C:\Data\CustData.txt to C:\BackUp\CustData.txt in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) _____. fso.FileCopy(”C:\BackUp\CustData.txt”, “C:\Data\CustData.txt”) fso.CopyFile(”C:\BackUp\CustData.txt”, “C:\Data\CustData.txt”) fso.FileCopy(“C:\Data\CustData.txt”,”C:\BackUp\CustData.txt”) Correct! fso.CopyFile(“C:\Data\CustData.txt”,”C:\BackUp\CustData.txt”) Question 4 2 / 2 pts (TCO 6) To delete a file in VBScript, use the following command (assuming fso is a Scripting.FileSystemObject) _____. Correct! fso.DeleteFile(Exists(“C:\Data\CustData.txt”) fso.EraseFile(Exists(“C:\Data\CustData.txt”) fso.FileErase(Exists(“C:\Data\CustData.txt”) fso.FileDelete(Exists(“C:\Data\CustData.txt”) Question 5 2 / 2 pts (TCO 6) The following command opens a text file in VBScript. Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???) To open a file for reading, the value of ? must be _____. the value of ? must be 2 the value of ? must be false the value of ? must be true Correct! the value of ? must be 1 Question 6 2 / 2 pts (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 _____. Correct! the value of ? must be 2 the value of ? must be true the value of ? must be 1 the value of ? must be false Question 7 0 / 2 pts (TCO 6) In VBScript, to read the contents of an entire text file into a string variable called fileStr, use the following method (assuming fileObj is a file object created with CreateTextFile( ) or OpenTextFile) _____. Correct Answer fileStr = fileObj.ReadAll You Answered fileObj.Read(fileStr) fileStr = fileObj.Read fileObj.ReadAll(fileStr) Question 8 2 / 2 pts (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 _____. Correct! the value of ??? must be 0 the value of ??? must be 2 the value of ??? must be -1 the value of ??? must be -2 Question 9 2 / 2 pts (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) _____. If fso.FolderNotFound(folderName) Then If fso.FolderFound(folderName) Then Correct! If fso.FolderExists(folderName) Then If fso.FolderCreated(folderName) Then Question 10 2 / 2 pts (TCO 6) In VBScript, to bypass reading the next four characters in a text file, use the following method (assuming fileObj is a file object created with OpenTextFile) _____. fileObj.Bypass(3) fileObj.Move(3) fileObj.Ignore(3) Correct! fileObj.Skip(3) Quiz Score: 16 out of 20 Previous [Show More]
Last updated: 3 years ago
Preview 1 out of 8 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Jan 09, 2021
Number of pages
8
Written in
All
This document has been written for:
Uploaded
Jan 09, 2021
Downloads
0
Views
66
Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·