Visual Basic Script (VBS) is a scripting language made for Windows. Most Windows programs use VBS in some way or another, so if you are a programmer using Windows, familiarizing yourself with Visual Basic is a good idea. You can edit a VBS file with any text editor, including Notepad.
- Step 1
Go to "Start," "Programs," "Accessories," "Notepad" to open Notepad.
- Step 2
Go to "File," "Open" and navigate to the location of your VBS file. Click "Open." You will see a whole bunch of VBS code.
- Step 3
At the top of the file, select some whitespace, and copy-paste the following Visual Basic code:
MsgBox("Hello World") - Step 4
Go to "File," "Save as..." and save the file with a different name, but keeping the ".vbs" suffix. For example, you could name your file "newScript.vbs" and click "Save."
- Step 5
Open the Command Prompt by going to "Start," "Programs," "Accessories," "Command Prompt." Navigate to the directory where you saved your VBS file by typing "cd C:\Your Directory Name Here" and hitting "Enter."
- Step 6
Type the name of your new VBS script and hit "Enter" to run the script. The script should run as it did (before you added your line of code), only this time a message box will pop up saying "Hello, World!"
No comments:
Post a Comment