VBScript Interview Preparation Guide
Download PDF

VBScript Interview Questions and Answers guide will educate you that VBScript in short is for Visual Basic Scripting Edition and VBScript is an Active Scripting language, developed by Microsoft, which uses the Component Object Model to access elements of the environment within which it is running just like the JavaScript. This VBScript Guide is a basic way of learning VBScript and preparation for the VBScript Interview Questions And Answers Interview Questions And Answers.

21 VBScript Questions and Answers:

1 :: Explain about VB Script?

VB script is a Microsoft programming language and it resembles a lower version of the VB. It is an Active Scripting language. This scripting language is included in windows operating system by default. With the use of msscript.ocx you can install VB Script.

2 :: Give examples where VB script can directly run on users system with Windows as OS?

A simple example detailing the running of VB Script is by utilizing Windows Script host environment. Visual basic is a stand alone application which has a .vbs as extension. Input can be provided through graphical user interface and output can be obtained by Wscript.exe from dialog and input boxes. From command line it can be invoked by Cscript.exe.

3 :: Explain VBScript in detail.

This is a scripting language developed by Microsoft and is based loosely on Visual Basic. Its functionality in a web environment is defendant upon either an ASP engine or the Windows Scripting Host, and must be used on a Windows hosting platform.

4 :: What are string functions in VBScript?

Asc() - Returns ANSI Character Code
Chr() - Returns Character from ANSI Code
InStr() - Find a string within another
InStrRev() - Find a string within another (Reverse)
LCase() - Convert a string to lowercase
Left() - Crops a string from left
Len() - Determine the length of a string
LTrim() - Remove leading spaces from a string
Mid() - Crops a string
Replace() - Replace a substring within a string
Right() - Crops a string from right
RTrim() - Remove trailing spaces from a string
Space() - Creates a string with the specified number of spaces
StrComp() - Compare two strings
String() - Creates a repeated character string
StrReverse() - Reverse the characters of a string
Trim() - Remove both leading and trailing spaces from a string
UCase() - Convert a string to uppercase

5 :: Explain few date functions in VBScript.

Date(),
Time(),
Now(),
Left(),
Right(),
Mid()

6 :: What is event handling in VBScript?

The actions that are performed by clicking, pressing keys, moving mouse, dragging and dropping etc are called as events. Event handling is the way to capture these events and perform the actions accordingly.

7 :: Explain about .wsf files?

.wsf files are modeled in similar to XML. They can be executed with the help of Wscript.exe and it can be done from the command line also. This .wsf file can have multiple visual basic files. Reuse functionality is present with this extension file.

8 :: Explain about the extension .hta?

.hta extension is used whenever you want to include a VB script in HTML. Here HTML acts as an interface and VB Script as the programming language. .hta extension files do run in the safe and trusted zone of Internet explorer. Although they run in the trusted zone querying is restricted as it has to pass the guidelines of internet explorer.

9 :: Explain some uses of VB Script?

If functionality aspect is considered VB Script acts similar to Java Script but it is compatible only on internet explorer. They interact with Document object model. Visual basic script can also be used for server side processing with ASP.

10 :: Compare JavaScript and VBScript?

VB and JavaScript are much similar in functionality. They both interact with the document object model of the page. Many browsers have compatibility with Java Script but they are not compatible with VB script as such. For client side scripting developers using VB Script should always make sure of cross browser compatibility which is not the case when working with VBScript.