If you haven??™t supplied a value, the script
assigns a default extension of TXT. The script uses the extension to locate information in the registry
such as the file open and print commands. Finally, the script uses the Popup() method to display
the output.
You should notice several differences between this example and the JavaScript example in Listing
6.1. First, the method for creating an object requires the use of a set??”you can??™t simply assign
the object to a variable. You??™ll also notice that VBScript has access to all of the standard Visual Basic
constants such as vbTab and vbCrLf. Finally, VBScript handles many of the method calls as subs,
not as functions. You need to exercise care when working in a mixed environment.
Using the Scripting Objects
A section of a chapter can??™t provide you with a complete tutorial on scripting. Some developers
require months to learn everything there is to know about the scripting language and the objects the
language controls. This section helps you understand the various objects that WSH supports.
You won??™t become a guru overnight, but you could create some simple scripts immediately after you
work through this chapter.
Pages:
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454