What is the VBS file format?
A .vbs file is a text file that contains source code written in VBScript (Visual Basic Script). Because .vbs files are executed directly by Windows, they should be treated with caution - they may contain malicious code. Related encoded variants are saved with the .vbe extension.
VBScript
VBScript is a scripting language created by Microsoft, derived from Visual Basic. It is commonly used for creating scripts and macros for various Windows applications and system automation tasks. VBScript is based on the BASIC language family but is a lightweight subset designed for scripting rather than standalone application development.
On Windows, .vbs files are run by Windows Script Host - either wscript.exe (with dialog output) or cscript.exe (console output). Scripts can automate file operations, read and write the registry, and control COM objects via CreateObject(). Broader automation workflows can combine .vbs scripts inside a .wsf container. Microsoft now recommends .ps1 for new scripting tasks, as VBScript support was deprecated in Windows 11 24H2.
Security & safety
RISK: HIGH.vbs is one of the classic Windows malware formats. Double-clicking a .vbs RUNS it immediately with your user privileges via Windows Script Host - it can delete files, edit the registry, download payloads or spread itself (the ILOVEYOU worm of 2000 was a .vbs). Rules: never run a .vbs that arrived by email, chat or download unless you wrote it or fully trust it; to inspect one, ALWAYS right-click > Edit (open as text) rather than open it, so it doesn't execute; be suspicious of double extensions like 'invoice.pdf.vbs'. Because of this history and VBScript's deprecation, many environments now block .vbs outright. If you received one unexpectedly, treat it as hostile and delete it.
Format details
in a nutshellPrograms that open VBS files
Technical details
deep spec| File type | Plain-text VBScript source code |
| Execution engine | Windows Script Host (WSH) |
| MIME type | text/vbscript |
| Binary signature | None - plain text; identified by VBScript keywords, not a byte sequence |
| Default GUI runner | wscript.exe |
| Default console runner | cscript.exe |
| VBScript version | 5.8 (final release, included with Windows 7 and later) |
| Case sensitivity | Case-insensitive - keywords and identifiers are not case-sensitive |
| Line continuation | Underscore character (_) at end of line |
| Error handling | On Error Resume Next / On Error GoTo 0 |
| Object access | COM and ActiveX objects via CreateObject() |
| Deprecation status | Disabled by default in Windows 11 24H2 (October 2024); planned full removal in a future release |
| Security risk | Can access filesystem, registry, and network with few restrictions - historically a common malware vector |
| Released | 1996 (VBScript 1.0, with Internet Explorer 3); Windows Script Host shipped from 1998 (Windows 98) |
| Specification | learn.microsoft.com |
VBS conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about VBS files.