Windows Script File
Filename extension |
.wsf |
---|---|
Internet media type | text/xml |
Developed by | Microsoft |
Type of format | Scripting |
Container for | Scripts |
A Windows Script File (WSF) is a file type used by the Microsoft Windows Script Host. It allows mixing scripting languages such as Perl, Object REXX, Python, Kixtart, JScript, and VBScript within a single file. These types of scripts may also be used to link many other external scripts together using a src
parameter on the <script>
tag in a manner similar to HTML. Windows Script Files have the extension ".WSF". A WSF makes reference to each script module in a very basic XML hierarchy as shown below.
Error isolation
A WSF may be useful for isolating errors. Its modular nature prevents one script reference from interfering with another. Here is a WSF example with one module that produces an error and one that does not:
<job id="Partially works"> '** This will not work <script language="VBScript"> WScript.echo 4/0 ' Oh boy! You cannot divide by zero... </script> '** This will work... definitely... <script language="VBScript"> WScript.echo "Hello Scripters!" & vbNewline & _ "Fantastic! It worked!" </script> </job>
The first script module will produce a "divide by zero" error. Typically this would cause the script to end in the Windows Script Host but this modular method allows the script to continue and execute the second script module.
External links
- Using Windows Script Files - From Microsoft's website
- Scripting Languages Available in the Script Center - From Microsoft's website