Saturday 18 May 2013

Date time functions in vb script

It is very important that you know how to work with date and time in VBScript as most of the VBScript programs will have date and time involved in it.

Below is the list of all date and time functions in vb script.
  1. date
  2. dateadd
  3. datediff
  4. datepart
  5. dateserial
  6. datevalue
  7. day
  8. hour
  9. minute
  10. second
  11. month
  12. monthname
  13. time
  14. timeserial
  15. timevalue
  16. weekday
  17. weekdayname
  18. year
We are going to have a look at each of these functions and examples in VBScript.
'To find current system date
msgbox " Current System date is -> " & date
'****************************************************************************

'To find the future or past date
msgbox "Tommorrow's date will be " & dateadd("d",1,date)

First argument is Interval Type and it can be of below types.

yyyy - Year
m - Month
d - Day
h - Hour
n - Minute
s - Second

'****************************************************************************
'To find the difference between 2 dates
msgbox "Day Difference between today and tommorrow is " & datediff("yyyy","9-jan-1986",date)

First argument is Interval Type and it can be of below types.

yyyy - Year
m - Month
d - Day
h - Hour
n - Minute
s - Second
'****************************************************************************
'To find the current day like 1,2,3...28
msgbox "Current day is -> " & day(date)

'****************************************************************************
'To find the current hour
msgbox "current hour is -> " & hour(now)

'****************************************************************************
'To find the current minute
msgbox "current minute is -> " & minute(now)

'****************************************************************************
'To find the current second
msgbox "current second is -> " & second(now)
'****************************************************************************

'To find the current month number like 1,2....11,12
msgbox "current month is -> " & month(now) 
'****************************************************************************

'To find the month name like Jan, Feb.....Dec
msgbox "current month name is -> " & monthname(month(now))
'****************************************************************************

'To find the current system time
msgbox "current time is -> " & time
'****************************************************************************

'To find the weekday number like 1,2....7
msgbox "current weekday is -> " & weekday(now)
'****************************************************************************

'To find the name of week day like sunday, monday...saturday
msgbox "current weekday Name is -> " & weekdayname(weekday(now))
'****************************************************************************

'To find the current year
msgbox "current year is ->" & year(now)
'****************************************************************************

'To find the parts of the given time stamp .equivalent to day, minute,hour, second etc
msgbox "Day part of the current timestamp" & datepart("d",now)
'****************************************************************************

'To convert the string to date
msgbox "String to date -> " & datevalue("09-jan-1986")
'****************************************************************************

'To convert the string to time
msgbox "String to time-> " & TimeValue("7:15:49 PM")
'****************************************************************************

'To create date from numbers 
msgbox dateserial(1986,01,09)
'****************************************************************************

'To create time from numbers
msgbox timeserial(17,01,09)
'****************************************************************************

String functions in vbscript

Below is the list of string functions in vb script
  1. lcase
  2. ucase
  3. len
  4. left
  5. right
  6. mid
  7. ltrim
  8. rtrim
  9. trim
  10. replace
  11. strreverse
  12. string
  13. Instr
  14. Instrrev
  15. strcomp
We are going to have a look at each String function mentioned above.

Substring Extraction functions

Some of the commonly used string manipulation functions are given below.
  • right
  • mid
  • left
All of the above functions are frequently used when performing any string operations in vbscript.
All of the above functions extract the part of the string / Sub string.

Right function returns the fixed number of characters from right side of the string.
Left function returns the fixed number of characters from left side of the string.
Mid function can be used to get the characters/ sub string from the left, right or middle part of the string.


Examples -

myString = "Sachin Plays Cricket"

print right(myString,7)  
'will return the 7 characters from the right side of myString    
'Cricket
print left(myString,6)
'will return the 6 characters from the left side of myString
'Sachin
print mid(myString,8,5)
'will return the 5 characters from the 8th position of myString
'Plays

Syntax -
Second parameter in left and right function tells how many characters to return from the string.
In mid functions there are 2 parameters. First parameter tells from which position of the string we have to get the characters and second parameter tells how many characters to return.

Converting Case of Strings

We can convert the string from lower case to upper case and vice versa using ucase and lcase functions in VBScript.

str = "We are learning strings in VBScript"
Msgbox lcase(str)
'It will print - we are learning strings in vbscript

Msgbox ucase(str)
'It will print - WE ARE LEARNING STRINGS IN VBSCRIPT

Replacing part of the string

Replace function can be used to replace the part of the string with other string. Syntax of replace is given below.

Replace(mainString,stringToFind,replaceString[,start_Index[,Replace_count[,comparison_mode]]])

More information on the parameters is given below.
  1. mainString - This is the original string
  2. stringToFind - This is the string which will be searched and replaced
  3. replaceString  - This is the string which will replace other string in the original string
  4. start_Index   - Index position of the original string from where you have to search it
  5. Replace_Count - How many occurrences of the string you want to replace
  6. Comparison_Mode - Binary (Case Sensitive) or textual comparison (Case Insensitive). by default it is binary comparison.

Examples -

mainString = "Sachin plays cricket"
msgbox replace(mainString,"Sachin","Arjun")
'Prints Arjun plays cricket.

Finding the length of the string

Len function is used to find the length of the string.

Example -
mainString = "Sachin plays cricket"
msgbox len(mainString)
'Prints 20

Trim functions of the string

Trim functions are used to remove the blank spaces from the beginning and ending of the string.
There are 3 functions in this category.

  1. ltrim - removes  blank spaces from left side of the string
  2. rtrim - removes  blank spaces from right side of the string
  3. trim -  removes  blank spaces from both left and right side of the string

Example -
mainString = "  Sachin plays cricket  "
msgbox ltrim(mainString)
'Prints  "Sachin plays cricket  "

msgbox rtrim(mainString)
'Prints  "  Sachin plays cricket"

msgbox trim(mainString)
'Prints  "Sachin plays cricket"

Reverse the string in VBScript

We can use strreverse function to reverse the string in VBScript.

Example  - 

mainString = "Sachin"
msgbox strreverse(mainString)
'Prints  "nihcaS"

String function in VBScript

We can use string function to get the specified character n times.

Example  - 

msgbox String(5,"*")
'prints *****


Instr function in VBScript

We can use instr function to find the substring in given string. Searching happens from the beginning of the string.

Syntax of Instr
InStr([start,]string1,string2[,compare])
msgbox instr(1,"sagaar","g")
'prints 3

Instrrev function in VBScript

We can use instrrev function to find the substring in given string. Searching happens from the end of the string but the position of the character is counted from the beginning of the string.

Syntax of Instrrev

InStrRev(string1,string2[,start[,compare]])
msgbox instrrev("sagaar","g")
'prints 3


Comparing 2 strings in VBScript

We can use StrComp function to compare two strings.
The StrComp function returns the values based upon comparison result.
  1. -1 (if string1 < string2)
  2. 0 (if string1 = string2)
  3. 1 (if string1 > string2)
  4. Null (if string1 or string2 is Null)
The syntax of the StrComp function is ->

StrComp (string1, string2 [, comparison_mode])

The last parameter determines whether comparison is binary or textual. By default it is binary comparison (Case Sensitive).

msgbox strcomp("Amol","Sagar") 'prints -1..since ascii value of A is less than that of S
msgbox strcomp("sagar","sagar") 'prints 0
msgbox strcomp("sagar","Amol") 'prints 1

Maths functions in vbscript

Below is the list of all maths functions in vb script

  1. Abs 
  2. Atn 
  3. Cos 
  4. Exp 
  5. Fix 
  6. Int 
  7. Log 
  8. Rnd 
  9. Sgn 
  10. Sin 
  11. Sqr 
  12. Tan 
  13. round
Let us have a look at each of these functions with examples.

'To find the absolute value 
Msgbox Abs(-11) 'prints 11

'To round the number
Msgbox round(22.346,2)  'prints 22.35

'To find the square root of the number
Msgbox Sqr (4)  'prints 2


Msgbox Exp(2)  'e^2

Difference between int and fix is that - If the number is negative, int  will return smallest possible integer value while fix will return largest possible integer value 
For positive numbers, both int and fix work the same way.

Msgbox Int (-8.4)  ' returns -9
Msgbox Fix(-8.4) 'returns  -8

'Calculates natural logarithm to the base e
Msgbox Log(10)

'gets the random number 
Msgbox Rnd()

'We must use Randomize function before Rnd to get different values

'To get the random numbers between 2 integers
max=100
min=1
Randomize
Msgbox (Int((max-min+1)*Rnd+min))

'This functions returns the integer number -1,0 or 1 depending upon the sign of the number.
'If the sign of the number is negative, -1
'if the number is zero , 0
'If the sign of the number is positive, 1

Msgbox Sgn(-11)  'prints -1


'Used for geometric calculations
Msgbox Sin(90) 
Msgbox Tan(45)
Msgbox Atn(45) 
Msgbox Cos(0)

File system object in vb script


Filesystemobject can be used to work with drives, folders, and files.

Filesystemobject  has methods and properties that allow us to create, delete, gain information about, and generally manipulate drives, folders, and files.

Important Methods of filesystemobject in vb script
  1. CopyFile
  2. CopyFolder    
  3. CreateFolder
  4. CreateTextFile
  5. DeleteFile
  6. DeleteFolder 
  7. DriveExists
  8. FileExists
  9. FolderExists
  10. GetAbsolutePathName
  11. GetBaseName   
  12. GetDrive
  13. GetDriveName
  14. GetExtensionName
  15. GetFile
  16. GetFileName
  17. GetFolder    
  18. GetParentFolderName
  19. GetSpecialFolder
  20. GetTempName
  21. MoveFile
  22. MoveFolder
  23. OpenTextFile 

Working with files


Creating and writing to file
 You can create a text file using this object.

Set obj = createobject("scripting.filesystemobject")
set f = obj.createtextfile("g:\salunke.txt")                      ' create a file
f.write str                ' write some data into file
set f= nothing           ' release memory
set obj = nothing

Reading from the file character by character
Set fo = createobject("scripting.filesystemobject")
  set stream1= fo.OpenTextFile("c:\abc.txt",1)
  msgbox stream1.AtEndOfStream
  Do While   (stream1.AtEndOfStream <> true )
    msgbox stream1.Read(1)
  loop
  stream1.Close
  Set stream1 = nothing

Appending data to file

set stream1= fo.OpenTextFile("c:\abc.txt",8)
  stream1.Write("append it")
                stream1.Close
  Set stream1 = nothing
  Set fo = nothing

Working with Folders

We can create, delete folders.

Working with Drives





Dictionary Object in vb script Example

Dictionary object is used to store the data in key-item pairs in qtp.

A Dictionary object is just like an associative array.
It stores the data in the form of key-item pairs.
Each key has some data item associated with it.
Key can be integer or string format.
Data item can be integer or string or array of variants. It may contain other dictionary itself.

Methods of Dictionary Object

Add ---------> Adds new key-item pair in the dictionary object
Exists --------> returns true if the given key exists in the dictionary object
Items --------> returns the array containing all items in the dictionary object
Keys --------> returns the array containing all keys in the dictionary object
Remove -----> removes the key-item pair with given key from the dictionary object
RemoveAll --> removes all key-item pairs from the dictionary object

Properties of Dictionary Object

Count-----------> returns the total number of keys in the dictionary object
Item-------------> assigns or returns the item value with given key from the dictionary object
Key-------------> sets the new key value for the given key
CompareMode -> assigns or returns the comparison mode for comparing string keys in a Dictionary object.

Example with dictionary object in VBScript

'create new dictionary object
Set dictionaryObject = CreateObject("Scripting.Dictionary")

dictionaryObject.CompareMode = 1

'add some key-item pairs
dictionaryObject.Add "1", "Sagar"
dictionaryObject.Add "2", "Amol"
dictionaryObject.Add "3", "Ganesh"

dictionaryObject.Key("3")  = "Bro"

Msgbox dictionaryObject.Item("Bro")

Msgbox dictionaryObject.Item("bro")

If  dictionaryObject.Exists("1") Then
 Msgbox "Dictionary contains key 1"
Else
 Msgbox "Dictionary does not contain key 1"
End If

'Display keys and items  in the dictionary
for each k in dictionaryObject.keys

 Msgbox  k & " - " & dictionaryObject.item(k)

next


'Display items
for each i in dictionaryObject.items

 Msgbox  i

next


Msgbox "Total number of keys in the dictionary are -> " & dictionaryObject.Count


'Remove the key-item pair with key = 1  from the dictionary object
dictionaryObject.Remove("1")

'Remove all key-item pairs from the dictionary object
dictionaryObject.RemoveAll

'Release the object
Set dictionaryObject = nothing

Please give your inputs, suggestions, feedback to Us about above VBScript topic. We value your thoughts.

Regular Expressions in vb script example

Regular expressions Basics

Definition :
A regular expression is a pattern of characters(meta characters and special characters).

General Applications of Regular Expressions :
Where are regular expressions used.
  1. Pattern Matching in Strings
  2. To find the occurrences of one string/pattern in given string.
  3. To replace the patterns with another string in a given text
All programming languages support the use of regular expressions. 

Examples on Regular Expressions:  
As I said earlier We use regular expressions to check if the given string matches the specified pattern.
For example - Consider a scenario where you have to validate that the given string should be a valid email address.

So list of valid email addresses are - reply2sagar@gmail.com, ayx@jjjj.in etc
Some of the invalid email addresses are - kjkjj@fdff, @dfdf.in etc

With the help of regular expression, you can easily validate the email address.

Syntax of Regular Expression in VBScript:
To write any VBScript program involving regular expressions, you will have to follow below steps.
  1. Create a regular expression object (RegExp)
  2. Define the pattern using RegExp object's pattern property.
  3. Use test method to check whether the given string matches with the pattern specified in step 2.
'Create the regular expression object
Set myRegEx = New RegExp 

'Specify the pattern (Regular Expression)
myRegEx.Pattern = "[a-z0-9]+@[a-z]+\.[a-z]+"

'Specify whether the matching is to be done with case sensitivity on or off.
myRegEx.IgnoreCase = True

'Use Test method to see if the given string is matching with the pattern
isMatched = myRegEx.Test("reply2sagar@gmail.com")

Variable isMatched will be true if the string "reply2sagar@gmail.com" matches with the given pattern 
"[a-z0-9]+@[a-z]+\.[a-z]+"


Another example on Regular Expression.

searchString = "Sachin tendulkar is the master blaster. Sachin lives in Mumbai and likes to play cricket."
searchPattern = "Sachin"


  Set reObject= New RegExp          ' Create a regular expression.
  reObject.Pattern = searchPattern   ' Set pattern.
  reObject.IgnoreCase = True          ' Set case insensitivity.
  reObject.Global = True                  ' Set global applicability.
  Set Matches = reObject.Execute(searchString)   ' Execute search.

  For Each M in Matches  
      Str = Str &  M.Firstindex &   "  ->  " &   M.Value &  vbCRLF
  Next

  Msgbox  Str

  Msgbox "String after replacing -> " & vbcrlf  & reObject.replace(searchString,"Arjun")


Below is the list of all meta characters used in regular expressions in VBScript

\ -  indicates that the next character would be a special character, a literal or a backreference

^  - Input String should be matched at the beginning.

$  - Input String should be matched at the end.

*  - Matches the preceding character zero or more times. It is same as {0,}.

+  -  Matches the preceding character one or more times.  It is same as {1,}.

?   - Matches the preceding character zero or one time.  It is same as {0,1}

{i} - Matches the previous character exactly i times.

{i,} - Matches the previous character at least i times and at most any time.

{i,j} -Matches the previous character at least i times and at the most j times.

.     -  Matches any single character except "\n".

(pattern) -  Matches pattern and captures the match that can be used in backreferences.
 p|q  -  Matches either p or q. Please note that p and q could be more complex regular expressions

[pqr]  - A character set. Matches any one of the character inside the brackets.

[^pqr]  - A negative character set. Matches any character not inside the brackets.

[p-z]   -  A range of characters. Matches any character in the specified range i.e p,q,r,....x,y,z.

[^p-z]  -  A negative range characters. Matches any character not in the specified range i.e. a,b,c...m,n,o

\b      -  Matches the boundary of the word

\B      -  Matches middle part of the word.

\d      -  Matches a digit character. same as [0-9].

\D      -  Matches a nondigit character. same as  [^0-9].

\f , \n and \r     -  Matches a form-feed character, newline and carriage character.

\s    - Matches any white space character including space, tab, form-feed. Equivalent to [ \f\n\r\t\v].

\S      - Matches any non-white space character. Equivalent to [^ \f\n\r\t\v].

\t  , \v   - Matches a horizontal and  vertical tab character.

\w      - Matches alpha numeric character including underscore. Equivalent to '[A-Za-z0-9_]'.

\W      - Matches any non - alpha numeric character. Equivalent to '[^A-Za-z0-9_]'.

\number- A reference back to captured matches.

*********************************************************************************
*********************************************************************************

Some examples on regular expressions:
  1. To match the 10 digit mobile number ->  \d{10}
  2. To match email address  -> \w+@\w+\.\w+
Please give your inputs, suggestions, feedback to Us about above VBScript topic. We value your thoughts.


difference between procedures and functions in vb script

Major difference between procedures and functions in vb script is that procedures can not return the value but functions can return the value.

Procedure Example -

Sub findsq()
   temp = InputBox("Please enter the number", 1)
   MsgBox "square root of the num is " & sqrt(temp)
End Sub


'Function Example
a = findsq()  ' function returns the value in variable a
msgbox a

function findsq()
 temp = InputBox("Please enter the number", 1)
findsq = sqrt(temp)
End function

Dynamic Arrays in vb script example

In Vb script we can define the dynamic array in vb script as mentioned below.
Size of dynamic array changes at run time. 

Example -
Dim a () - declared dynamic array a

To use dynamic array, you must use redim statement.
ReDim a(22)
 . . . 
ReDim Preserve a(44)   ' Preserve statement preserves the elements in array
 

How we can define array in vb script

Arrays are used to store multiple values in the same variable.

We can define array in vb script in 4 different ways.
  • dim a(10)  - static array of 11 elements
  • dim b()   - dynamic array
  • a = array(1,2,3,4) - declare array with values
  • a = split("as*dfdf*sdsd","*") - array is automatically created with a(0) = as, a(1)=dfdf , a(2)=sdsd
Various Operations that can be performed on the array are mentioned below
  1. Iterate through all elements in the array
  2. Find the lower bound and upper bound of the array
  3. Filter the array
  4. Join the elements in the array
  5. Sort the elements in the array
1. Iterate through all elements in the array
Below example will illustrate how we can access all elements in the array.


a = array(34,5,66,"sagar", 44.4)

for i=0 to ubound(a)
    
    'Print each element in the array one by one.   
    msgbox a(i)
   
next

2.Find the upper bound and lower bound in the array
Below example will illustrate how we can find the upper bound and lower bound of the array.

a = array(34,5,66,"sagar", 44.4)
Msgbox ubound(a) 'print 4
Msgbox lbound(a) 'prints 0

3.Filter the array
We can use filter function to filter elements in the array.

Syntax of the Filter method is given below.
'Filter(arrayToSearch,substringToSearch[,include [,compare]])

  1. arrayToSearch - This is the array whose elements will be searched
  2. substringToSearch - String to search in array
  3. include - this can be true/false. If true, it will return all matching values If false, it will return all non-matching values. Default is true.
  4. compare - this flag can be 0 or 1. If 0 means it will be binary comparison. else it will be textual comparison. Default is binary comparison -0


Below example will illustrate how we can filter the elements in array.

'***********************************************************
a = array("amol","sachin","arjun","Sagar")
b = filter(a,"s",true,0)
' b = filter(a,"s")    .....both are same ...binary comparison....case sensitive

for i=0 to ubound(b)
 msgbox b(i)  'will print sachin
next
'***********************************************************
a = array("amol","sachin","arjun","Sagar")
b = filter(a,"s",true,1)

for i=0 to ubound(b)
 msgbox b(i)          'will print sachin and Sagar........textual comparison....case insensitive
next
'***********************************************************
a = array("amol","sachin","arjun","Sagar")
b = filter(a,"s",false,1)

for i=0 to ubound(b)
 msgbox b(i)   'will print amol and arjun ........non-matching elements.
next

4. Join the elements in the array

Join function is used to join the elements in the array.

a = array("sachin", "plays", "cricket")
msgbox join(a)  'will print sachin plays cricket

a = array("sachin", "plays", "cricket")
msgbox join(a,"*")  'will print sachin*plays*cricket



Types of Array in vb script


There are 2 types of arrays in vb script.
  • Static(Fixed Size)
  • Dynamic
Static Arrays
Static array can contain fixed number of elements in array.
Example -
dim a (10) - This static array will contain only 11 elements.
If you want to increase/decrease the size of array, it will not be possible.

Dynamic Arrays

In dynamic array we can change the size of array.

Dim b() - This is how we define dynamic array.

To use dynamic array we must define the size.

Redim b(5) - Array b redefined with size of 5 means it can contain 6 elements.

Array containing 6 elements

Now if you want to increase the size of elements in array you can use below statment

redim b(7) - In this case array can contain 8 elements but previous elements will be erased.



To preserve the contents of the array,  we can use
Redim preserve b(7)



When we reduce the size of dynamic array , data of the array is lost.

For example if we have a array b

redim preserve b(8)

and we execute below statement

redim preserve b(3) 
Then we will not be able to access the elements at  the index 4 onwards.

Erasing elements in the Array
We can use erase statement to remove the data from fixed size array. Please note that memory is still occupied by the array after erasing in fixed size array.

'Erasing Fixed size array
Dim a(2)
a(0)=11
Erase a

We can use erase statement to release the memory occupied by the dynamic array.
'Erasing Dynamic Array
Dim da()
ReDim da(2)
da(0) = 12
Erase da

Please note that we can have multi-dimensional arrays as well.Dim twodim(5, 10)
In above array, there will be 6 rows and 11 clolumns

Types of variables in Vbscript

Variables are storage locations in memory where we can store the the values.

In vb script there are 3 types of variables.
  • Scalar  - contains only one value.
  • Array - contains many values.
  • Const - Constant variables
Scalar variable Example in vb script -
Dim a
a = 10

In above vb script example we have a variable called a with value as 10. We can store only one value in that variable at any point of time.

Array variable Example in vb script - 
Dim a (10)

 a(1) = 22
a(4) = 23

In above vb script example we have a variable called a with size of 10. We can store 11 value in that variable at any point of time.

Const variable Example in vb script - 
Const variable is a variable whose value does not change during the execution of the program.

const a=10

Data Types in vbscript

In vb script all variables are initialized with the data type called variant.
But we can have below sub-types in vb script.

In below table we have mentioned all sub data types in vb script. In next post we will see how to use these sub data types in vb script examples.


Subtype
Description
Empty
Variable is uninitialized. Value is 0 or ""
Null
Variable has Invalid data.
Boolean
True/False
Byte
Contains integer (0 to 255).
Integer
Contains integer (-32,768 to 32,767).
Currency
-922,337,203,685,477.5808 to 922,337,203,685,477.5807.
Long
Contains integer (-2,147,483,648 to 2,147,483,647).
Single
Contains a single-precision, floating-point number
Double
Contains a double-precision, floating-point number
Date (Time)
Contains a date
String
Contains a String
Object
Contains an object.
Error
Contains an error number.


Examples -

In below example we have a variable x and we have assigned a value 10 to x. In the next statement 
when we use typename method to check the data type of variable x then it will show it as a integer.

x = 10
MsgBox TypeName(x) 'prints integer
x = 11.1

MsgBox TypeName(x) 'prints double

If we store the value 11.1 in the same variable x, then it's data type will be shown as Double. So this is how data type of the variables keep changing in the VBScript. So VBScript language is called as loosely typed language. And the mechanism to determine the data type of variables at runtime is called as late binding.

Data Type Conversion
We can also convert the data type of the variable explicitly using various data type conversion functions.
For example - In below code we have a VBScript which will convert the decimal number into integer.
a = 11.3

Msgbox TypeName(a) 'prints double

a = cint(a)
Msgbox Typename(a) 'prints Integer

Other data type conversion functions are.
  1. cdbl - converts to double
  2. cstr - converts to string
  3. cbool - converts to boolean
  4. cbyte - converts to byte
  5. ccur - converts to currency
  6. cdate - converts to date
  7. clng - converts to long integer





What is vbscript?

VBScript Intoduction

Vb script is a scripting language used for performing administrative tasks in system programming.
Vb script is a loosely typed language meaning we don't need to define the type of variables in vbscript.
It is used only on Microsoft operating system.

VBScript Applications

VbScript  is used in many places.
  1. In windows administrative tasks.
  2. In QTP as automation scripting language.
  3. In html pages as a client side scripting language.
  4. It is also used in embedded applications
  5. VBScript is also used as server side scripting language in native ASP pages with IIS Web Server.

How to execute VBScript

You can write and execute the vbscript programs on only Windows based machines. You can create the file with extension .vbs and then double click it to execute the code inside it. Below figures show how to do it on windows 7 machine.


Open Folder and Search Options




Uncheck hide extensions for known file types




Create a vbscript program in notepad and Save with .vbs extension.. Double click to Execute





Total Pageviews