×

Top 30 VB Script Interview Questions for 2024

1) What is VB Script?

VBScript stands for Visual Basic Scripting Language. It is a light version of Microsoft Visual Basic. It is a client side scripting Language.

2) What is the stable version of VBScript?

The stable version of VBScript is 5.8.

3) What are the features of VBScript?

The features of VBScript are:
It is a lightweight scripting language.

It is easy to learn.

It uses COM (Common Object Model).

It executes in host environment such as IE, IIS and WSH.

4) How can we write a simple program?

We can write a simple program by using following steps:
<html>  

<body>  

            <script language="vbscript" type="text/vbscript">  

            document.write("Hello World!")  

            </script>  

</body>  

</html>

5) What are the environments where VBScript could be run?

VBScript could be run into three environments that are:
IIS (Internet Information Server)

WSH ( Windows Script Host)

IE ( Internet Explorer)

6) How can we declare the variable in VBScript?

We can declare the variable by using DIM keyword. Example: Dim name.

7) What are the technologies used by VBScript?

VBScript use following technologies:
Functions

String manipulation

Subroutines

Data/time

Error Handling, etc.

8) Is VBScript case sensitive?

No, VBScript is case sensitive but function name, keywords , variables and identifiers are case sensitive.

9) What are string functions in VBScript?

There are various functions in VB Script:
Asc(): It returns ANSI character code.

UCase(): It conver a string to uppercasse.

InStr(): It is used to find a string within another.

Lcase(): It convert a srting to lowercase.

Ltrim(): It removes leading space from a string.

10) How can we assign a date and time value to a variable?

We can assign a date and time value to a variable by using hash symbol(#).

11) What are the operators of VBScript ?

VBScript operators are:
Arithmetic Operators

Comparison Operators

Logical (or Relational) Operators

Concatenation Operators

12) How can we create cookies in VBScript?

We can create cookies by assign a string value to the document.cookie object. Syntax:
document.cookie = "key1 = value1; key2 = value2; expires = date";

13) How can we create a class in VBScript?

We can create a class in VBScript by using enclosed within Class .... End Class. Example:
'Defining the Class  

Class classname    'Declare the object name  

...  

End Class  

' Instantiation of the Class  

Set objectname = new classname

14) How to throw an error in VBScript?

In VBScript, an error is thrown by Err.Raise. Example:
Err.Raise 6   ' Raise an overflow error.

15) Who is the developer of VBScript?

Microsoft is the developer of VBScript.

16) What are the filename extensions of VBScript?

The filename extension of VBScript are .vbs , .vbe, .wsf, .wsc.

17) What are the host environments of VBScript?

Host environment of VBScript are WSH(Windowj- Script Host), IE( Internet Explorer), IIS(Internet Information Services).

18) In VBScript how can we comment any statement?

In VBScript, we can comment with single Quote(‘). Example:
<script language="vbscript" type="text/vbscript">  

<!-  

  'comment line with single quote  

  ' Hello VBScript  

//- >  

      

</script>

19) What the rules are for declare variables?

There are following rules for declaring variable:
  • Variable Name must begin with an alphabet.
  • Variable names cannot exceed 255 characters.
  • Variables Should NOT contain a period(.)
  • Variable Names should be unique in the declared context.

20) Can we change the value of constant during the script Execution?

No the value of Constant cannot be change during the Script Execution.

21) Write an example of Do…Until loop?

The example of Do..Until loop is given below:
<!DOCTYPE html>  

<html>  

<body>  

<script language="vbscript" type="text/vbscript">  

  i=10  

  Do Until i>15  'Condition is False.Hence loop will be executed  

    ii = i + 1  

    Document.write("The value of i is : " & i)  

    Document.write("<br></br>")  

  Loop   

</script>  

</body>  

</html>

22) What are the mathematical functions used in VBScript?

In VBScript, there are various mathematical functions used like Log, Rnd, Sgn, Abs, Hex and many more.

23) Which function is used to reverse the sequence of the characters of the given string?

StrReverse() function is used to reverse the sequence of the characters of the given string.

24) Can we start an array index with negative?

No, we cannot start an array index with negative.

25) What is the use of Redim statement?

ReDim statement is used to declare dynamic array and allocate or reallocate storage space.

26) What is a Dialog Box?

Dialog Box is just like a message box. It is used to display a message to a user . Synatx:
MsgBox(prompt[,buttons][,title][,helpfile,context])

27) How to assign a data value to a variable?

Date and Time variables should be enclosed within hash symbol(#).

28) How can we create cookies in VBScript?

We can create a cookies to assign a string value to the document .cookies object. Syntax:
document.cookie = "key1 = value1; key2 = value2; expires = date";

29) What are sub procedures in VBScript?

In VBScript, sub procedures are different from function that is given below:
  • Sub procedures does not return a value
  • Sub procedures can be called without call keyword.
  • Sub procedures are always enclosed within Sub and End Sub statements.

30) What is the use of Scripting.FileSystemObject class in VBScript?

In VBScript, Scripting.FileSystemObject class is used for the developer to work with drivers, folders and files. Example:
Dim oFS, drive  

Set oFS = CreateObject("Scripting.FileSystemObject")  

Set drive = oFS.GetDrive(oFS.GetDriveName("C:\"))  

Document.write drive.VolumeName

Related Topics

Artificial Neural Network Interview Questions

1. Explain Neural Network?  Neural Network is a sequence of an algorithm that gives its best to recognize the underlying relationship in a data-set through a process. The artificial neural network...

8 minutes read.

Top 31 Flask Interview Questions for 2024

1) What is Flask? Flask is a micro web framework written in Python. It is based on Werkzeug toolkit and Jinja 2 template engine. 2) Who is the developer of Flask? Armin Ronacher...

6 minutes read.

Top 22 MariaDB Interview Question for 2024

1) What is MariaDB? It is a community based database devoloped by MySQL Devolopers. It provides same features as MySQL also, can be said that it is a replacement of MySQL. 2)...

3 minutes read.

Top 26 CouchDB interview questions for 2024

1) What is CouchDB? CouchDB is a document typed database server which can be accessed through RESTful JSON API. It is a schema free and Ad-hoc database with a flat address...

4 minutes read.

Top 30 Swift Interview Questions for 2024

1) What is Swift? It is an innovative programming language developed by Apple Inc. It is used for creating applications for iOS and OS X. 2) What are the features of Swift Programming? Features...

4 minutes read.

Top 15 SVG Interview Questions for 2024

1) What is SVG? SVG stands for Scalable Vector Graphics, It is XML based format used to draw dimentional vector images. It is a W3C standard. SVG supports all image formats. 2) What are...

2 minutes read.

Top 15 ExpressJS Interview Questions for 2024

1) What is ExpressJs? Express Js is a framework for node.js which is light-weight and fast. It is used to develop web and mobile applications. 2) What are the features of ExpressJs? Following...

4 minutes read.

Top 15 PouchDB Interview Questions for 2024

1) What is PouchDB? PouchDB is an in-browser database that allows applications to save data. It is an open source database. It runs in Node.js. 2) In which language PouchDB was written? PouchDB was written in JavaScript language. 3)...

2 minutes read.

Top 28 Scala Interview Questions for 2024

1) What is Scala? Scala is a functional and object-oriented programming language. It is used to develop web application, mobile application, enterprise application, desktop based application etc. Everything in Scala is in object...

4 minutes read.

Top 10 WCF Interview Questions for 2024

  1. What is WCF? Windows Communication Foundation (WCF), earlier known by the name Indigo, is a run-time platform and a set of APIs in the .NET Framework for building, configuring, and...

7 minutes read.

Top 15 NodeJS Interview Questions for 2024

1) What is NodeJs? NodeJs is open source JavaScript based feamework used to develop I/O intensive web application. It is collections of JavaScript library and runtime environment. It is used to...

3 minutes read.

PhoneGap Interview Questions 2024

Top 50 Phonegap Interview Questions with their Answers Once you have acquired practical knowledge of the PhoneGap technology, you will now be able to search for a job as a mobile...

9 minutes read.

Symfony PHP Framework Interview Questions

1) What is Symfony? Symfony is an open source, web application framework. It is written in PHP and used to design PHP applications. It was first released on18 October, 2005. 2) What...

5 minutes read.

Top 10 GWT Interview Questions for 2024

1) What is Google Web Toolkit (GWT)? GWT (Google Web Toolkit) is a development toolkit. It is used to develop Ajax web applications using Java. GWT compiler translates Java sour ce...

2 minutes read.

Top 15 Erlang Interview Questions for 2024

1) What is Erlang÷ Erlang is an open source programming language. It is used to build massively scalable soft real-time systems. It has runtime environment. It supports concurrency, fault tolerance and...

2 minutes read.

Top 15 Java Collections Interview Questions for 2024

1) What is Collections in Java? It is a framework which is used to store and manipulate the group of objects. 2) What are the commonly used methods of Collection interface in...

2 minutes read.

Top 15 Java Multithreading Interview Questions for 2024

1) What is Multithreading in Java ? It is a process of executing multiple threads simultaneously. It is used to achieve multitasking. It is mostly used in animation and games etc. 2) What are...

4 minutes read.

Top 15 CherryPy Interview Questions for 2024

1) What is CherryPy? CherryPy is a web framework used for Python. It provides a friendly interface for Http protocol for Python developer. 2) Why we use CherryPy? CherryPy has following strength: Simplicity: It...

3 minutes read.

Top 13 SAS Interview Questions for 2024

1. What is SAS and its functions? SAS (Statistical Analysis System) is statistical software designed by SAS Institute in 1960 for data inspection and report writing. SAS runs on Windows, UNIX...

5 minutes read.

Top 18 UiPath Interview Questions for 2024

RPA UiPath Interview Questions and Answers for Fresher  1. What is RPA? RPA is an acronym for Robotic Process Automation. Robotic In RPA, Robotic is termed as an entity or machine which tries to...

7 minutes read.