You can prepare a script from scratch using Notepad, the editor in Microsoft Windows, simply by launching Notepad and entering statements using the syntax of the selected script language (as discussed in Chapter 1). Then you store the script program in a script file, as shown in Figure 2-1. For VBScript you use the extension .vbs, for JScript you use the extension .js, and for Microsoft Windows Script Host (WSH) 2 you use the extension .wsf. (For more information about .wsf files, refer to the section "The New .wsf File Format" in Chapter 1.)
In the Save As dialog box, select All Files in the Save As Type drop-down list to see all the script files in the selected folder.
Figure 2-1 Saving a script file in Notepad
Building a script from scratch isn't the best approach, however. For example, if you use the header comments that I recommended in Chapter 1, you must add them explicitly each time you create a new script. Instead, you can use the template files VBScript.vbs and JScript.js to build script files and use the template file WSHfile.wsf for .wsf files. You simply configure Windows so that it recognizes script templates:
Figure 2-2 Registering a script template using Tweak UI
You'll find three new commands—JScript Script File, VBScript Script File, and Windows Script File—on the New shortcut menu, as shown in Figure 2-3. You can use these commands to create a new script file in any folder.
Figure 2-3 Creating a new script file using the shortcut menu
Tweak UI is a Windows tool for customizing the operating system, and you must install it explicitly. Windows 98 users can find this module on the Windows 98 CD in the \tools\reskit\powertoy folder. Windows 95, Windows NT 4, and Windows 2000 users can download a version of Tweak UI from several Internet sites. (Search http://www.microsoft.com for the most recent version.) To install the tool, browse the directory to find the folder with the Tweak UI installation files. Right-click on the file TweakUI.inf, and choose Install from the shortcut menu. After you install the tool, the Tweak UI icon will appear in the Control Panel folder.