What is MIME type "text/x-vbscript"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
The MIME type text/x-vbscript indicates that the file contains VBScript source code.It is plain text meant for scripting environments. The code is executed by an interpreter such as the Windows Scripting Host or embedded in web pages for legacy Internet Explorer setups.
Files using this MIME type usually have the VBS extension.
- Automation tasks – Automate system operations and administrative routines.
- System management – Execute scripts for Windows management and configuration.
- Legacy web scripting – Provide client-side functionalities in older web environments.
Associated file extensions
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: text/x-vbscript
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="text/x-vbscript">Download file</a>
Server-side (Node.js)
Setting the Content-Type header in Node.js:
const http = require('http');
http.createServer((req, res) => {
res.setHeader('Content-Type', 'text/x-vbscript');
res.end('Content here');
}).listen(3000);
Associated file extensions
FAQs
Do modern browsers support the text/x-vbscript MIME type?
No, modern browsers like Chrome, Firefox, and Edge do not execute VBScript. This MIME type was strictly supported by legacy versions of Internet Explorer. Today, all client-side web logic should be written in JavaScript using the text/javascript MIME type.
Are files served as text/x-vbscript dangerous?
They can be a significant security risk because .vbs files are executable on Windows operating systems. Malicious scripts are frequently distributed via email to automate malware installation. Always verify the source before executing any file with the vbs extension.
How do I configure Apache to serve .vbs files correctly?
To ensure the server sends the correct Content-Type header, add the MIME mapping to your httpd.conf or .htaccess file. Use the directive AddType text/x-vbscript .vbs so that clients identify the file as VBScript source code rather than generic plain text.
What is the difference between text/vbscript and text/x-vbscript?
Both MIME types refer to the same VBScript language. text/vbscript was often used within HTML <script> tags in Internet Explorer, while text/x-vbscript (where the 'x' stands for experimental or non-standard extension) is frequently seen in email headers or server configurations. Functionally, they describe the same plain text content.
How can I run a text/x-vbscript file on Windows?
These files are executed by the Windows Script Host (WSH). You can double-click the file to run it via wscript.exe (windowed mode) or execute it via the command line using cscript filename.vbs (console mode) for administrative tasks.
What tools can I use to edit text/x-vbscript files?
Since the content is plain text, you can use any text editor. Simple tools like Windows Notepad work fine, but developers often prefer Notepad++ or Visual Studio Code for syntax highlighting and easier debugging of the script logic.
Why does my browser download the .vbs file instead of running it?
Most modern browsers are configured to download .vbs files for security reasons rather than executing them. Additionally, since browsers other than IE lack the VBScript engine, they cannot interpret or run the code, treating it simply as a downloadable file.
General FAQ
What is a MIME type?
A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.
MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.
MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.
How do I find the MIME type for a file?
You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.
Why are multiple MIME types listed for one extension?
Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.