We will be working with "vbs" files for now. VBS means Visual Basic Script, and is automatically on all PCs running Windows.

VBS files are text files with an extension ".vbs", and the extension tells Windows to execute the file. VBS files are problematic in the sense that they, like any program file, are considered security risks in browsers and email. So there will be a lot of copying and pasting of code.

First, make a "vbs" folder on your pc, somewhere that you can write and save files (probably c:\users\public)

Create a shortcut on your screen to your vbs folder

Copy the below text in red, paste it into Notepad, then save as lesson01.vbs in your vbs folder.


'this is a COMMENT line, beginning with a single quote

'In this program, we will get input from the user, write to the screen, and write to a file

option explicit  'should always be first executable line - forces declaration of variables

dim somename, somestunum
somename = InputBox("What is your name?","name input","Roger Kaputnik")
wscript.Echo "Hello, " & somename
somestunum = InputBox("What is your student number?","stunum input","1437658")

'whenever we create an output file, we need the following two lines
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")

Set MyFile = fso.CreateTextFile("lesson01.csv", True) 
MyFile.WriteLine("name,stunum")   

dim csvline
csvline=somename & "," & somestunum
MyFile.WriteLine(csvline)
MyFile.Close

wscript.echo "done - lesson01.csv created"
wscript.Quit

Click on the link, and the vbs program should run - you will see what it does.

To see the code in the vbs file, right-click on lesson01.vbs and "open with" Notepad.

Please send me a Messenger message to tell me how it goes.

end