FILE FORMAT GUIDE

Windows Script File (.WSF)

A WSF file packages Windows Script Host jobs in XML. It can contain script code and references to external code; double-clicking an associated file can execute a job rather than preview a document.

Quick facts

Extension
.wsf
Format
Windows Script File
Category
system
MIME type
Unknown
Standard / developer
Microsoft
Open with
Notepad or Visual Studio Code

What is WSF?

WSF adds an XML wrapper around one or more script jobs. A job may use a supported scripting engine such as VBScript or JScript. The format is distinct from a plain VBS script, and its ability to reference other code matters when reviewing an unfamiliar file.

How to open WSF

Use the source-specific workflow below and preserve the original file.

Notepad or Visual Studio CodeWindows / macOS / Linux (text inspection)

Start the editor first and use File > Open to read the .wsf file as text. Do not choose Run, WScript or CScript for an unfamiliar file. Reading XML does not prove that the embedded script or referenced files are safe.

Common uses and compatibility

  • Package script jobs, runtime metadata and references to external scripts.

Things to check

  • Windows Script Host executes selected jobs; it is not an inert file viewer.
  • Actual execution depends on installed engines and policy. VBScript is deprecated, so do not assume permanent availability.

Technical details

Signature
Unknown
Encoding
XML text; character encoding depends on the document
Container
Unknown
Compression
Unknown

Public specification: unknown.

How to view a WSF file without running it

Read it from a text editor instead of launching it through its Windows file association. The XML wrapper may contain executable code and external script references.

  1. Open a text editor first.
  2. Use File > Open to select the WSF file and inspect its jobs and script references.
  3. Keep unfamiliar code unexecuted. Do not change system policy or enable an engine merely to open an attachment.

Sources: Visual Studio Code: opening files and language support · Microsoft MSDN archive: WSF XML jobs and script packaging

WSF vs VBS: what is the difference?

VBS stores VBScript source directly. WSF packages jobs with XML elements and can host scripts in different supported languages. Changing .vbs to .wsf does not add the required structure.

Sources: Microsoft MSDN archive: WSF XML jobs and script packaging

What are job and package elements?

The archived Microsoft documentation describes a job element for a script job and a package wrapper for multiple jobs. Windows Script Host has a job selector for a named job in a WSF file. These are execution controls, not a guarantee of safety.

Sources: Microsoft MSDN archive: WSF XML jobs and script packaging · Microsoft: Windows Script Host (wscript)

Which software runs WSF files?

WScript and CScript are Windows Script Host execution hosts. Their ability to run a particular file depends on the required language engine and system policy. The older format documentation does not guarantee that every engine remains installed on current Windows.

Sources: Microsoft: Windows Script Host (wscript) · Microsoft: deprecated Windows features (VBScript)

Is a WSF attachment safe because it is XML?

No. WSF can contain or reference executable scripts. A meaningful review must include the script content and dependencies. Keep an unexpected attachment unexecuted and do not use the file extension as a trust signal.

Sources: Microsoft MSDN archive: WSF XML jobs and script packaging

Related formats

  • VBScript File

    VBScript source can be executed by Windows Script Host; WSF adds a job wrapper rather than making scripts safe.

  • Extensible Markup Language

    WSF uses XML structure, but its intended behavior is script execution, not ordinary document viewing.

Sources & review

Sources reviewed 2026-11-03.