.WSF

WSF File

Windows Script File
Ask a question
QUICK ANSWER

A .wsf file is a Windows Script File - an XML-format script that Windows Script Host (WSH) executes natively on all Windows versions. To read it safely, right-click and open with Notepad or Notepad++; do not double-click a file you did not create yourself. WSF files are a well-documented malware delivery method used by ransomware families including Locky and Cerber.

Developer: Microsoft Corporation Category: Executable Files MIME: text/plain
OPENS ON Windows
Related: .APK · .EXE · .VBS · .JAR

On this page

19k+ extensions indexed
Last reviewed Sep 1, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the WSF file format?

Files with the .wsf extension are scripts for the Microsoft Windows Script Host (WSH). These are text files that comply with XML format. They can be opened for editing in any text editor, but it is advisable to use a dedicated tool such as Visual Studio Code. A single .wsf file can include multiple scripting jobs and support various scripting languages within one document.

Default scripting languages supported in .wsf files include JScript and VBScript. However, the format is designed to be independent of the scripting language - after installing a compatible engine in WSH, it can also support languages such as:

  • PerlScript,
  • Python,
  • BASIC,
  • Ruby,
  • PHP,
  • Object REXX.

By integrating different scripting languages, it is possible to use functions defined in one language alongside constants from declared objects. This brings the creation of .wsf scripts closer to traditional programming methods.

.wsf script files are used for logging and system administration, and are commonly used for automating various system tasks. Scripts can be run in GUI mode via WScript.exe, in console mode via CScript.exe, or accessed programmatically as a COM object through WShom.ocx. Debugging tools are also available.

PowerShell scripts have largely replaced .wsf for modern Windows automation since Windows 7, but WSH remains present on all current Windows versions. Important security note: .wsf files are a known malware delivery mechanism - ransomware and downloaders have widely abused .wsf email attachments. Treat any unsolicited .wsf file with extreme caution.

Security & safety

RISK: HIGH

WSF files are a major malware delivery vector on Windows. Windows Script Host executes .wsf natively without any special installation, and the XML container allowed early email filters to miss them as plain text. Ransomware campaigns (Locky 2016, Cerber, Sage 2017, Nemucod downloader) used malicious .wsf email attachments extensively. Risk factors: (1) .wsf can download and execute further payloads via WScript.Shell and XMLHTTP objects; (2) can modify registry, create files, and invoke system commands; (3) no UAC elevation required for many destructive actions; (4) executes silently via wscript.exe double-click. Mitigation: block .wsf at email gateways; disable WSH via Group Policy (HKLM\Software\Microsoft\Windows Script Host\Settings → Enabled = 0); never execute an unexpected .wsf. Use a text editor to inspect before running.

Format details

in a nutshell
FULL NAMEWindows Script Fileaka WSF Script, Windows Script Host File
DEVELOPERMicrosoft Corporationsince 1999 with Windows Script Host 2.0 (shipped with Windows 2000; downloadable for Windows 98/NT)
MIME TYPEtext/plain
TYPEXML-based multi-language script file for Windows Script Host (WSH)

Programs that open WSF files

Windows5 apps
Windows Notepad Built-in Right-click the .wsf file → Open with → Notepad to view source without executing.
Notepad Open-source Open the .wsf file in Notepad++ to read, edit, or inspect it safely without executing.
Windows Script Host (wscript.exe) Built-in Double-click the .wsf file to execute via wscript.exe (GUI mode). WARNING: only run trusted files.
Windows Script Host Console (cscript.exe) Built-in Open Command Prompt and run: cscript filename.wsf - executes in console mode with text output.
Visual Studio Code Open-source Open the file; VS Code recognizes XML and provides syntax highlighting. Debug WSH with appropriate extension.

Technical details

deep spec
File formatWell-formed XML document; <package> root element (optional) contains one or more <job id="..."> elements, each grouping one or more <script> blocks
EncodingText; UTF-8 or Windows-1252 (ANSI); character encoding specified in the XML declaration at the file head
XML job elementsEach <job> can contain <script language="VBScript|JScript">, <reference> (type library constants), <object> (COM instantiation), <include> (external .vbs/.js files), and <runtime> (argument docs)
Built-in script enginesJScript and VBScript are built into WSH on all Windows versions; additional engines (PerlScript, Python, Object REXX) require separate installation and registry registration
Multi-language per jobA single <job> block can mix JScript and VBScript <script> sections, sharing COM objects and constants across language boundaries
Execution modesGUI mode: wscript.exe (dialogs allowed, no console); console mode: cscript.exe (stdout/stderr available); COM object access: WShom.ocx
WSH host versionsWSH 5.8 ships with Windows 7 through Windows 11 and is the version on all current systems; WSH 5.6 ran on Windows XP
Typical file size1 KB - 200 KB; most scripts are compact single-purpose files
Security classificationHigh-risk executable; WSH runs .wsf files natively on double-click with no user confirmation; widely exploited for ransomware (Locky, Cerber, Sage) and malware dropper delivery via email attachments
PlatformWindows only; Windows Script Host is not available on macOS or Linux
Default execution handlerWindows associates .wsf with wscript.exe by default; the association can be changed to cscript.exe or disabled entirely via Group Policy for security hardening
Modern successorPowerShell (.ps1) has largely replaced .wsf for Windows system administration since Windows 7; WSH remains present on all current Windows but is not actively developed by Microsoft
Released1999 with Windows Script Host 2.0 (shipped with Windows 2000; downloadable for Windows 98/NT)
Latest versionWSH 5.8 (Windows 7 / Server 2008 R2; version in all later Windows editions)
Specificationlearn.microsoft.com

WSF conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with WSF files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about WSF files.

Frequently asked questions

Is a .wsf file dangerous?
It can be. WSF files execute scripts natively on Windows without any special software, and they have been used extensively in ransomware and malware campaigns. Never run a .wsf file you received unexpectedly - open it in a text editor first to inspect the code.
How do I run a .wsf script?
Double-click it to run in wscript.exe (GUI mode), or open a Command Prompt and type: cscript filename.wsf for console mode. Only run scripts you trust.
How do I open a .wsf file to read the code without executing it?
Right-click the file → Open with → Notepad (or Notepad++, VS Code). Do not double-click to open - that executes the script.
What is the difference between .wsf and .vbs or .js?
.vbs files contain only VBScript and .js only JScript. A .wsf (Windows Script File) is an XML wrapper that can include both VBScript and JScript blocks in the same file, plus multiple independent jobs, COM object declarations, and external file includes.
Can I disable .wsf execution in Windows?
Yes - disable Windows Script Host via Group Policy or registry: HKLM\Software\Microsoft\Windows Script Host\Settings, set Enabled to 0. This prevents all WSH-based script execution (including .vbs and .js).
What should I use instead of .wsf for new scripts?
PowerShell (.ps1) is Microsoft's recommended modern scripting platform. It is pre-installed on Windows 7+ and provides far greater capability, security controls, and IDE support than WSH.
Can .wsf files be blocked at email gateways?
Yes - and they should be. Most modern email security gateways (Microsoft Defender for Office 365, Proofpoint, Mimecast) block .wsf attachments by default or via policy.

References

1Microsoft Docs - Windows Script Host (WSH)learn.microsoft.com
2Wikipedia - Windows Script Fileen.wikipedia.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.MDMarkdown Document
3.CRDOWNLOADChrome Partial Download File
4.BINCD/DVD Disc Image (BIN/CUE)
5.PARTPartial Download File
6.NOMEDIAAndroid No-Media Marker File
7.RPMSGRestricted Permission Message
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.ICSiCalendar data file

Related extensions

.APKAndroid Package
.EXEWindows Executable (Portable Executable)
.VBSVBScript file (Visual Basic Script)
.JARJava Archive
.EX4MetaTrader 4 Compiled Program (Expert Advisor / Indicator / Script)
.APPXMicrosoft Windows App Package (AppX)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z