Home > Articles > Operating Systems

  • Print
  • + Share This
  • 💬 Discuss
This chapter is from the book

Introducing Script Files

Scripts look complex, but they're actually nothing but simple text files. This means that you can create and edit script files using Notepad or some other text editor. You can use a word processor such as WordPad to create and edit scripts, but you must make sure that you save these files using the program's Text Only document type. For VBScript, a good alternative to Notepad is the editor that comes with either Visual Basic or any program that supports VBA (such as the Office suite). Just remember that VBScript is a subset of VBA (which is, in turn, a subset of Visual Basic), so it does not support all objects and features.

In a web page, you use the <script> tag to specify the scripting language you're using, as in this example:

<SCRIPT LANGUAGE="VBScript">

With the Windows Script Host, the script file's extension specifies the scripting language:

  • For VBScript, save your text files using the .vbs extension (which is registered as the following file type: VBScript Script File).
  • For JavaScript, use the .js extension (which is registered as the following file type: JScript Script File).

As described in the next three sections, you have three ways to run your scripts: by launching the script files directly, by using WScript.exe, or by using CScript.exe.

  • + Share This
  • 🔖 Save To Your Account

Discussions

comments powered by Disqus