How to Make, Save, and Run a Simple VBScript Program?

05 Aug, 2021
VBScript is a lightweight scripting version of the popular Microsoft Visual Basic, developed by as the name suggests, Microsoft. It is used to develop dynamic web pages. It is much lighter compared to Visual Basic programming language but works as a scripting language like JavaScript. To run VBScript on the client-side, the client must have to use Internet Explorer because other browsers are still not supported by the VBScript. 
Just like many other simple scripting languages, VBScript can be written on a simple word editor, like notepad and other such softwares (e.g. notepad++, Wordpad, etc.). Refer the following steps to get a better idea of making a VBScript program: 
Step 1: Open up a word editor of your choice (Here, notepad is used). 
  Step 2: For now, here is a simple VBScript program that will make a simple message dialog box to appear on the screen. The code for such a program in VBScript is:  
a = msgbox("Have a good day, fellow GFG reader!", 0, "Making a VBScript program")
 
Code Explanation: You can put anything as long as it follows the variable declaration rules in VBScript instead of “a” which is at the beginning of the above code. Effectively, We can break and understand the above code in the following manner:  
put_any_Variable_name = msgbox("Your main text here", 0, "Your title text here")
  To change the property of the dialog box with respect to what you need, refer the following data: 
Change “0” in the above written code with any of the numbers provided just above. To get more than one above mentioned property in you dialog box, you can simple write, for example: “0+16”, instead of “0” in above code. For reference, the code:  
hydro = msgbox("Remember to drink water!", 0+64, "Hydration Check")
will give the following output:  
That’s it, we have just written a basic VBScript program that will display a dialog box as output. Now onto saving this program. 
 
Follow the steps given below to save a VBScript program: 
Step 1: Press Ctrl + Shift + S on the keyboard, Or click File>Save As on the notepad window, this will open up a Save As dialog window asking where to save the current notepad document.  
  Step 2: Now write any file name of your choice for this notepad document but make sure you write .vbs as its extension. Make sure to add “.vbs” after writing the file name in the “File name:” field.  
  Step 3: Now, change the value of “Save as type:” field from “Text Documents (*.txt)” to “All Files (*.*)” by clicking on it with help of the drop down menu.  
  Step 4: Finally, click on save after choosing an appropriate location of where the file should be saved to.  
 
Now, this is a very simple thing to do, simply double click on the now saved .vbs file from wherever you saved it and voila! It will run and give you the following output:  
 
adamyaswarup087
VBScript
How To
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Java Tutorial
How to Align Text in HTML?
How to Install FFmpeg on Windows?
How to Install Jupyter Notebook on MacOS?
How to setup Anaconda path to environment variable ?
How to insert spaces/tabs in text using HTML/CSS?
Installation of Node.js on Linux
Top 10 Projects For Beginners To Practice HTML and CSS Skills
Node.js fs.readFileSync() Method
How to set the default value for an HTML <select> element ?