AI Code

vbscript Creating Your First Script


To begin, in Windows, create a text document on your desktop (Right-click>New>Text Document.) Change the the extension from ".txt" to ".vbs". At this point it is executable by double clicking it(nothing will happen if you try, there's nothing in it yet.) To edit, right-click document and click edit. Add the example code for your first program.



Hello World

Just a simple hello world to start. Copy paste the below into the document, save then double click.

MsgBox "Hello World"

enter image description here


"MsgBox" displays a message in a dialog box and waits for the user to respond.
This is a good method to inform users of actions to be performed or simply the end of the script.
Such as:

Got any vbscript Question?