Interview Questions

AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions Blockchain Interview Questions Bootstrap Interview Questions C Interview Questions C Programming Coding Interview Questions C# Interview Questions C++ Interview Questions Cakephp Interview Questions Cassandra Interview Questions CherryPy Interview Questions Clojure Interview Questions Cobol Interview Questions CodeIgniter interview Questions CoffeeScript Interview Questions Cordova Interview Questions CouchDB interview questions CSS Buttons Interview Questions CSS Interview Questions D Programming Language Interview Questions Dart Programming Language Interview Questions Data structure & Algorithm Interview Questions DB2 Interview Questions DBMS Interview Questions Django Interview Questions Docker Interview Questions DOJO Interview Questions Drupal Interview Questions Electron Interview Questions Elixir Interview Questions Erlang Interview Questions ES6 Interview Questions and Answers Euphoria Interview Questions ExpressJS Interview Questions Ext Js Interview Questions F# Interview Questions Firebase Interview Questions Flask Interview Questions Flex Interview Questions Fortran Interview Questions Foundation Interview Questions Framework7 Interview Questions FuelPHP Framework Interview Questions Go Programming Language Interview Questions Google Maps Interview Questions Groovy interview Questions GWT Interview Questions Hadoop Interview Questions Haskell Interview Questions Highcharts Interview Questions HTML Interview Questions HTTP Interview Questions Ionic Interview Questions iOS Interview Questions IoT Interview Questions Java BeanUtils Interview Questions Java Collections Interview Questions Java Interview Questions Java JDBC Interview Questions Java Multithreading Interview Questions Java OOPS Interview Questions Java Programming Coding Interview Questions Java Swing Interview Questions JavaFX Interview Questions JavaScript Interview Questions JCL (Job Control Language) Interview Questions Joomla Interview Questions jQuery Interview Questions js Interview Questions JSF Interview Questions JSP Interview Questions KnockoutJS Interview Questions Koa Interview Questions Laravel Interview Questions Less Interview Questions LISP Interview Questions Magento Interview Questions MariaDB Interview Questions Material Design Lite Interview Questions Materialize CSS Framework Interview Questions MathML Interview Questions MATLAB Interview Questions Meteor Interview Questions MongoDB interview Questions Moo Tools Interview Questions MySQL Interview Questions NodeJS Interview Questions OpenStack Interview Questions Oracle DBA Interview Questions Pascal Interview Questions Perl interview questions Phalcon Framework Interview Questions PhantomJS Interview Questions PhoneGap Interview Questions Php Interview Questions PL/SQL Interview Questions PostgreSQL Interview Questions PouchDB Interview Questions Prototype Interview Questions Pure CSS Interview Questions Python Interview Questions R programming Language Interview Questions React Native Interview Questions ReactJS Interview Questions RequireJs Interview Questions RESTful Web Services Interview Questions RPA Interview Questions Ruby Interview Questions Ruby on Rails Interview Questions SAS Interview Questions SASS Interview Questions Scala Interview Questions Sencha Touch Interview Questions SEO Interview Questions Servlet Interview Questions SQL Interview Questions SQL Server Interview Questions SQLite Interview Questions Struts Interview Questions SVG Interview Questions Swift Interview Questions Symfony PHP Framework Interview Questions T-SQL(Transact-SQL) Interview Questions TurboGears Framework Interview Questions TypeScript Interview Questions UiPath Interview Questions VB Script Interview Questions VBA Interview Questions WCF Interview Questions Web icon Interview Questions Web Service Interview Questions Web2py Framework Interview Questions WebGL Interview Questions Website Development Interview Questions WordPress Interview Questions Xamarin Interview Questions XHTML Interview Questions XML Interview Questions XSL Interview Questions Yii PHP Framework Interview Questions Zend Framework Interview Questions

Top 30 VB Script Interview Questions for 2022

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



ADVERTISEMENT
ADVERTISEMENT