- VBScript Tutorial
- VBScript - Home
- VBScript - Overview
- VBScript - Syntax
- VBScript - Enabling
- VBScript - Placement
- VBScript - Variables
- VBScript - Constants
- VBScript - Operators
- VBScript - Decisions
- VBScript - Loops
- VBScript - Events
- VBScript - Cookies
- VBScript - Numbers
- VBScript - Strings
- VBScript - Arrays
- VBScript - Date
- VBScript Advanced
- VBScript - Procedures
- VBScript - Dialog Boxes
- VBScript - Object Oriented
- VBScript - Reg Expressions
- VBScript - Error Handling
- VBScript - Misc Statements
- VBScript Useful Resources
- VBScript - Questions and Answers
- VBScript - Quick Guide
- VBScript - Useful Resources
- VBScript - Discussion
VBScript Mock Test
This section presents you various set of Mock Tests related to VBScript Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
VBScript Mock Test IV
Q 1 - Which of the following event is triggered when an object goes out of scope or when the object is set to Nothing in VBScript?
Answer : B
Explaination
Class_Terminate is triggered when an object goes out of scope or when the object is set to Nothing.
Q 2 - What is purpose of Scripting.FileSystemObject class in VBScript?
B - This class provides methods to work with drives, folders and files.
Answer : A
Explaination
This class provides file system objects which help the developers to work with drives, folders and files.
Q 3 - What is the purpose of Drive object of Scripting.FileSystemObject class in VBScript?
B - Drive contains methods and properties that allow developers to create, delete or move a file.
C - Drive provides a list of all files contained within a folder.
D - Drive provides methods and properties that allow developers to create, delete or move folders.
Answer : A
Explaination
Drive contains methods and properties that allow you to gather information about a drive attached to the system.
Q 4 - What is the purpose of File object of Scripting.FileSystemObject class in VBScript?
B - File contains methods and properties that allow developers to create, delete or move a file.
C - File provides a list of all files contained within a folder.
D - File provides methods and properties that allow developers to create, delete or move folders.
Answer : B
Explaination
File contains methods and properties that allow developers to create, delete or move a file.
Q 5 - What is the purpose of Files object of Scripting.FileSystemObject class in VBScript?
B - Files contains methods and properties that allow developers to create, delete or move a file.
C - Files provides a list of all files contained within a folder.
D - Files provides methods and properties that allow developers to create, delete or move folders.
Answer : C
Explaination
Files provides a list of all files contained within a folder.
Q 6 - What is the purpose of Folder object of Scripting.FileSystemObject class in VBScript?
B - Folder contains methods and properties that allow developers to create, delete or move a file.
C - Folder provides a list of all files contained within a folder.
D - Folder provides methods and properties that allow developers to create, delete or move folders.
Answer : D
Explaination
Folder provides methods and properties that allow developers to create, delete or move folders.
Q 7 - What is the purpose of Folders object of Scripting.FileSystemObject class in VBScript?
A - Folders provides a list of all the folders within a Folder.
B - Folders contains methods and properties that allow developers to create, delete or move a file.
C - Folders provides a list of all files contained within a folder.
D - Folders provides methods and properties that allow developers to create, delete or move folders.
Answer : A
Explaination
Folders provides a list of all the folders within a Folder.
Q 8 - What is the purpose of TextStream object of Scripting.FileSystemObject class in VBScript?
A - TextStream provides a list of all the folders within a Folder.
B - TextStream enables developers to read and write text files.
C - TextStream provides a list of all files contained within a folder.
Answer : B
Explaination
TextStream enables developers to read and write text files.
Q 9 - What is the purpose of RegExp object in VBScript?
A - RegExp object helps the developers to match the pattern of strings.
B - RegExp object provides methods to help us to work with Regular Expressions easily.
Answer : C
Explaination
Both of the above options are correct.
Q 10 - Which of the following is correct about RegExp object?
Answer : D
Explaination
All of the above options are correct.
Q 11 - Which of the following is correct about RegExp.Test method?
Answer : C
Explaination
Both of the above options are correct.
Q 12 - Which of the following is correct about RegExp.Replace method?
B - If there are no match then the original search-string is returned.
Answer : C
Explaination
Both of the above options are correct.
Q 13 - Which of the following is correct about RegExp.Execute method?
Answer : C
Explaination
Both of the above options are correct.
Q 14 - Which of the following is used to capture a runtime Error in VBScript?
Answer : A
Explaination
If we want to capture the error, then Err Object is used.
Q 15 - Which of the following is used to throw an error in VBScript?
Answer : A
Explaination
Use Err.Raise to throw an error.
Q 16 - Which of the following is used to get error details in VBScript?
Answer : C
Explaination
Err.Number gives the error number and Err.Description gives error description.
Q 17 - Which of the following is used to clear error in VBScript?
Answer : A
Explaination
Err.Clear clear an error.
Answer : B
Explaination
No! VBScript is a case-insensitive language. This means that language keywords, variables, function names and any other identifiers need NOT be typed with a consistent capitalization of letters.
Q 19 - Which of the following is true about numeric value assignment in VBScript?
A - The numeric values should be assigned without double quotes.
B - The numeric values should be enclosed within doublequotes(").
C - The numeric values should be enclosed within hash symbol(#).
Answer : A
Explaination
The numeric values should be assigned without double quotes.
Q 20 - Which of the following is true about string value assignment in VBScript?
A - The string values should be assigned without double quotes.
B - The string values should be enclosed within doublequotes(").
C - The string values should be enclosed within hash symbol(#).
Answer : B
Explaination
The string values should be enclosed within doublequotes.
Q 21 - Which of the following is true about date value assignment in VBScript?
A - The date values should be assigned without double quotes.
B - The date values should be enclosed within doublequotes(").
C - The date values should be enclosed within hash symbol(#).
Answer : C
Explaination
The date values should be enclosed within hash symbol.
Q 22 - Which of the following is true about time value assignment in VBScript?
A - The time values should be assigned without double quotes.
B - The time values should be enclosed within doublequotes(").
C - The time values should be enclosed within hash symbol(#).
Answer : C
Explaination
The time values should be enclosed within hash symbol.
Answer : A
Explaination
+ operator concatenates two Values if values are string. So A + B will give VBScript.
Answer : B
Explaination
& operator concatenates two values. So A + B will give 510.
Answer : A
Explaination
& operator concatenates two values. So A & B will give VBScript.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | B |
2 | A |
3 | A |
4 | B |
5 | C |
6 | D |
7 | A |
8 | B |
9 | C |
10 | D |
11 | C |
12 | C |
13 | C |
14 | A |
15 | A |
16 | C |
17 | A |
18 | B |
19 | A |
20 | B |
21 | C |
22 | C |
23 | A |
24 | B |
25 | A |