Question:
VBscript Text File Input and Output help.?
Rey 619
2011-11-28 09:38:00 UTC
1. What WSH object is used for VBScript File I/O?

a. Scripting.FileSystemObject
b. FileSystemObject
c. Scripting.FileSystem
d. WScript.FileSystemObject

2. What file attribute value in VBScript indicates that the file is ReadOnly?

a. 0
b. 1
c. 2
d. 4

3. To test to see if a file is not ReadOnly, use the following VBScript code.

a. If NOT file.Attributes OR 1 Then
b. If NOT file.Attributes AND 1 Then
c. If NOT file.Attributes XOR 1 Then
d. If file.Attributes NOT 1 Then

4. To copy the file C:\Data\CustData.txt to C:\BackUp\CustData.txt in VBScript, use the following command (assuming that fso is a Scripting.FileSystemObject).


a. fso.FileCopy(“C:\Data\CustData.txt”,”C:\BackUp\CustData.txt”)
b. fso.FileCopy(”C:\BackUp\CustData.txt”, “C:\Data\CustData.txt”)
c. fso.CopyFile(“C:\Data\CustData.txt”,”C:\BackUp\CustData.txt”)
d. fso.CopyFile(”C:\BackUp\CustData.txt”, “C:\Data\CustData.txt”)

5. The following command opens a text file in VBScript.

Set file = fso.OpenTextFile(“C:\Data\CustData.txt”, ?, ??, ???)

To open a file for appending, the value of ? must be _____.

a. 1
b. 2
c. 8
d. True

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 as Unicode, the value of ??? must be _____.

a. 0
b. -1
c. 2
d. - 2
Four answers:
【  ⌣̈  】
2011-11-29 22:39:25 UTC
1. a

2. b

3. b

4. c fso.CopyFile( “C:\Data\CustData.txt”, "C:\BackUp\CustData.txt”)

5. c

6. a
?
2016-10-07 05:34:06 UTC
Custdata
erica
2016-09-16 07:15:31 UTC
Want to know more about this as well
chuyangher
2016-12-17 14:03:50 UTC
@echo off rem This batch document will create abc.txt and def.txt with rem strains of text cloth written to the information. cls cd "%userprofilep.c.workstation" echo it quite is the 1st line of text cloth > "abc.txt" echo it quite is the 2nd line >> "abc.txt" echo it quite is the third line >> "abc.txt" echo it quite is the fourth line >> "abc.txt" echo it quite is the final line of text cloth >> "abc.txt" rem New text cloth document to be created echo this could be a sparkling line of text cloth to a sparkling document > "def.txt" echo this could be a 2nd line of text cloth to def.txt >> "def.txt" echo final line of text cloth >> "def.txt" echo Abc.txt and def.txt has been created on your workstation. pause >nul go out you additionally can create batch information with this technique: @echo off cls cd "%userprofilep.c.workstation" echo @echo off > "batfile1.bat" echo cls >> "batfile1.bat" echo hi worldwide >> "batfile1.bat" echo pause >> "batfile1.bat" echo go out >> "batfile1.bat" echo batfile1.bat has been created on your workstation. echo. pause go out


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...