Apps Install or Uninstall VBScript Feature in Windows 11


  • Staff
VBS_banner.png

This tutorial will show you how to install or uninstall the VBScript optional feature for all users in Windows 11.

A .vbs file is a Virtual Basic script written in the VBScript scripting language. It contains code that can be executed within Windows via the Windows-based script host (Wscript.exe), to perform certain admin and processing functions.

VBScript is a legacy Scripting engine component, and Microsoft does not recommend using this component unless it is really required. Use this component at your own risk, this might contain security vulnerabilities.

Starting with Windows 11 build 25309, you can now uninstall the VBScript feature if wanted.

VBScript is being deprecated. In future releases of Windows, VBScript will be available as a feature on demand before its removal from the operating system.



You must be signed in as an administrator to install or uninstall the VBScript optional feature.



Contents

  • Option One: Install or Uninstall VBScript Feature in Settings
  • Option Two: Install or Uninstall VBScript Feature using Command




Option One

Install or Uninstall VBScript Feature in Settings


1 Open Settings (Win+I).

2 Perform one of the available options below: (see screenshots below)
  • Click/tap on Apps on the left side, and click/tap on Optional features on the right side.
  • Click/tap on System on the left side, and click/tap on Optional features on the right side.

VBScript_Settings-1.png
Optional_Features_Settings-1b.png

3 Do step 4 (add) or step 5 (remove) below for what you want.

4 Install VBScript Feature

This is the default setting.


A) Click/tap on the View features button. (see screenshot below)​

VBScript_Settings-3.png

B) Check VBSCRIPT, and click/tap on Next. (see screenshot below)​

VBScript_Settings-4.png

C) Click/tap on Install to confirm. (see screenshot below)​

VBScript_Settings-5.png

D) You can now close Settings if you like.​

5 Uninstall VBScript Feature

A) Under Installed features, click/tap on VBSCRIPT to expand it open. (see screenshot below)​

B) Click/tap on the Uninstall button.​

VBScript_Settings-2.png

C) You can now close Settings if you like.​




Option Two

Install or Uninstall VBScript Feature using Command


1 Open Windows Terminal (Admin), and select Windows PowerShell or Command Prompt.

2 Copy and paste the command below you want to use into Windows Terminal (Admin), and press Enter. (see screenshots below)

Default - Install VBScript Feature
DISM /Online /Add-Capability /CapabilityName:VBSCRIPT~~~~

OR​

Uninstall VBScript Feature
DISM /Online /Remove-Capability /CapabilityName:VBSCRIPT~~~~

3 When prompted to restart the computer, type Y to restart now.

VBScript_command-2.png

VBScript_command-1.png



That's it,
Shawn Brink


 

Attachments

  • VBS.png
    VBS.png
    12.3 KB · Views: 69
Last edited:
Before you remove it, confirm if you're using WScript functions inside any PowerShell scripts. For example, running a PS wrapper to make it windowless, or using SendKeys.
 

My Computer

System One

  • OS
    Windows 7
So I guess Cscript.exe files are out to.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self Built
    CPU
    AMD R7 5700g
    Motherboard
    ASROCK 570 Steel Legend
    Memory
    32Gb
    Graphics Card(s)
    NVIDIA GeForce GTX 1650
    Sound Card
    Realtek ALC1220 Audio Codec
    Monitor(s) Displays
    1
    Screen Resolution
    1920 x 1080
    Hard Drives
    2 1Tb ssd,, 1 512Gb ssd, 1 256Gb ssd, and 1Tb Hdd
    PSU
    RAIDMAX Thunder RGB RX-735AP-R 735 W
    Case
    Cougar MX331 Mesh
    Cooling
    5 Assorted brands
    Keyboard
    Dell
    Mouse
    Microsoft
    Internet Speed
    FIOS
    Browser
    Chrome
    Antivirus
    MalwareBytes
So I guess Cscript.exe files are out to.
CScript.exe is a console host for running VBScript and JScript scripts. If you uninstall VBScript, you'll still be able to run JScript using CScript.exe or WScript.exe.

Anything you can do with VBScript, you can also do with JScript, so I really see no point in disabling or uninstalling one and not the other.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
Fresh install. No option in GUI or using DSIM to install VBSCRIPT

Edition Windows 11 Pro
Version 22H2
Installed on ‎19/‎09/‎2023
OS build 22621.2134
Experience Windows Feature Experience Pack 1000.22659.1000.0
 

My Computer

System One

  • OS
    Windows 11
Fresh install. No option in GUI or using DSIM to install VBSCRIPT

Edition Windows 11 Pro
Version 22H2
Installed on ‎19/‎09/‎2023
OS build 22621.2134
Experience Windows Feature Experience Pack 1000.22659.1000.0
Note that this tutorial is only applicable to the Canary channel build 25309 or higher. It is currently not applicable to any other channel.

Also note that VBScript is installed on all Windows 11 builds.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
Note that this tutorial is only applicable to the Canary channel build 25309 or higher. It is currently not applicable to any other channel.

Also note that VBScript is installed on all Windows 11 builds.
Thank you for the clarification. Details provided to get confirmation from someone else as this doesnt appear to be the case in this instance (GA).

EDIT: its .dll appears to be on disk and in the correct place. "C:\Windows\System32\vbscript.dll"
 
Last edited:

My Computer

System One

  • OS
    Windows 11
My use case was windowless screenshots using task scheduler. I had set execution policy as remotesigned in PowerShell 7 which apparently is set differently to 5.1, once i fixed that in 5.1 it all started working again. Ooops.
 

My Computer

System One

  • OS
    Windows 11
After you remove VBScript, can you still use Classic ASP (using VBScript) on a Windows11, using IIS or IIS Express?
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
    Browser
    Chrome
    Antivirus
    Windows Defender
After you remove VBScript, can you still use Classic ASP (using VBScript) on a Windows11, using IIS or IIS Express?
No. Removing Vbscript totally removes it.

If you were to only disable WSH (Windows Script Host) you can still use Vbscript in Classic ASP or in an HTA.

Also note that you can still use JScript in Classic ASP and HTAs after removing Vbscript.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
Thanks! This is good to know. And it's very bad news. I'm still hosting 300 websites using Classic ASP/VBScript. No way I can update those to JScript or .NET...
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
    Browser
    Chrome
    Antivirus
    Windows Defender
Thanks! This is good to know. And it's very bad news. I'm still hosting 300 websites using Classic ASP/VBScript. No way I can update those to JScript or .NET...
I expect VBScript will remain available as a quick and easy optional install for years to come (like SMB 1).
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
You're probably right. And that's why it's such a stupid decision. Windows hosting companies will no doubt keep on serving Classic ASP/VBScript. I can understand they disabled VBScript for Edge (MS had better removed Edge completely). But killing off a very popular scripting language, come'on.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
    Browser
    Chrome
    Antivirus
    Windows Defender
@Pieter Cooreman As I'm sure you're aware, Microsoft essentially killed off VBScript, as a web language, with the introduction of IE 11 in 2013, so you're maxed out at IE 10 capabilities when using VBScript in web pages. Recently, I was searching around for a website that still required IE, but just gave up and made a local test page and here you've got 300 of them. Are any of those publicly accessible?

BTW, you can add code, like the following, to the top of your key web pages to ensure that users, who have removed VBScript, get a proper error message:

Code:
<script language="VBScript">
Dim TestVar
</script>
<script language="JScript">
try { if (TestVar) {} }
catch(Err) {
  alert("VBScript has been disabled or uninstalled.");
  self.close();
  window.close();
}
</script>
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
@LesFerch Yes sure, I'm aware VBScript has been taken out of Internet Explorer a while ago. But what I'm interested in here, is whether you can still use VBScript as server-side language in IIS on Windows 11 (in this case) after you've uninstalled it. Maybe Mr. Brink can shed a light? This would require IIS or IIS Express on your local machine, and a text-editor... Let me know if I can help to give this a whirl... Happy to help... thx!
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
    Browser
    Chrome
    Antivirus
    Windows Defender
@LesFerch Yes sure, I'm aware VBScript has been taken out of Internet Explorer a while ago. But what I'm interested in here, is whether you can still use VBScript as server-side language in IIS on Windows 11 (in this case) after you've uninstalled it. Maybe Mr. Brink can shed a light?
When it's uninstalled from Windows 11, it really is totally uninstalled. It won't be available in IIS or anywhere else. But you're not going to uninstall it from your own server and if Microsoft removes it in a future update, it will be available to reinstall for years, if not decades, to come.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
@LesFerch would you be so kind to post the error message you get when you request an .asp from your localhost in IIS? What exactly does IIS return when you request an asp page in case VBScript is deleted?
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
    Browser
    Chrome
    Antivirus
    Windows Defender
@LesFerch would you be so kind to post the error message you get when you request an .asp from your localhost in IIS? What exactly does IIS return when you request an asp page in case VBScript is deleted?
My previous testing was for client side, so all I used was an HTM file, but I have set up IIS before (years ago) so I'm familiar with it. If I get a chance, I'll set up a test, but it might be quicker for you to do yourself if you have a test server to play with.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
The only 2 hosts that I have access to is my old Windows 10 laptop, and a production Windows Server 2019. None of these allow me to remove VBScript yet... I hope you can help me out, but I sure understand if that takes some time...
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
    Browser
    Chrome
    Antivirus
    Windows Defender
Back
Top Bottom