See ???How to Access the Registry,???
earlier in this chapter, for a Registry function that solves this problem.
ActiveX component can??™t create object
Runtime error: you??™ll get this when you try to use the Set statement, as
described throughout this chapter, and for whatever reason, WSH
isn??™t familiar with the object you??™re trying to initialize. Typically,
objects are extensions to WSH, some of which come with Windows
Vista, some of which are installed through Add or Remove Programs,
and some of which come with third-party programs. The resolution
usually involves installing the missing component (which usually can be
found on the Web), but depends entirely upon the specific object
reported by the error.
Object References | 543
Scripting and
Automation
If you plan on distributing your scripts, you??™ll want to take steps to eliminate
any error messages that may pop up. See the ???How to Manipulate
Files??? example script, earlier in this chapter, for more information on error
trapping and the On Error Resume Next statement.
Find a Better Editor
Notepad is a very rudimentary text editor. Although it does the job, it
doesn??™t go any further than making it possible to write and save VBScript. It
has no toolbar, no syntax highlighting, no visible line numbers, and no
macro feature. If you find yourself writing VBScript files often, you??™ll want
to use a better editor. Now, Windows also comes with WordPad, although
it doesn??™t do much more than Notepad in helping to write scripts, and it has
that creepy Microsoft Word??“like interface.
Pages:
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756