/

How to Install or Uninstall VBScript Feature in Windows 11

by Richelle Arevalo, IT Technical Writer
How to Install or Uninstall VBScript Feature in Windows 11 blog banner image
How to Install or Uninstall VBScript Feature in Windows 11 blog banner image

Try our #1 rated endpoint management platform on G2

NinjaOne dashboard screenshot

Automate the Hardest Parts of IT

VBScript (Visual Basic Scripting Edition) is a legacy scripting language that was once widely used for automation in Windows environments. In Windows 11, it is no longer enabled by default and is now treated as an optional feature. Users can manually install VBScript to maintain compatibility with legacy scripts or enterprise applications, or uninstall it for security reasons.

Managing this feature allows you to enforce standardized configurations across devices and helps prepare systems for its complete deprecation in future Windows releases. This guide will show you how to install or uninstall VBScript on Windows 11.

📌 Recommended deployment strategies:

Click to Choose a Method 💻

Best for Individual Users

💻💻💻

Best for Enterprises

Method 1: Install or uninstall via Optional Features (GUI) ✓
Method 2: Install or uninstall via PowerShell ✓
Method 3: Install or uninstall via DISM (Command Prompt) ✓

🎥 This visual guide shows How to Install or Uninstall VBScript Feature in Windows 11.

How to enable or disable VBScript on Windows 11

These methods apply to Windows 11 version 22H2 and later. After installation or removal, a system restart may be required for the changes to take effect.

Method 1: Install or uninstall via Optional Features (GUI)

📌 Use Cases: Best for non-technical users or one-time configuration

📌 Prerequisites: Administrator access required

To install VBScript:

  1. Press Win + I to open Settings.
  2. Go to System > Optional Features.
  3. Click View features at the top.
  4. In the search box, type VBScript.
  5. Select VBScript from the list and click Next.
  6. Click Install and wait for the process to complete.
  7. Restart your PC to apply changes. [Refer to #4 in ⚠️Things to look out for.]

To uninstall VBScript: [Refer to #1 in ⚠️Things to look out for.]

  1. Press Win + I to open Settings.
  2. Go to System > Optional Features.
  3. Scroll down to Installed features and find VBScript.
  4. Click the three-dot menu next to VBScript and click Uninstall.
  5. Restart your PC to apply changes. [Refer to #4 in ⚠️Things to look out for.]

💡 Note: The process may take a few minutes.

Method 2: Install or uninstall via PowerShell

📌 Use Cases: Ideal for system administrators or users managing multiple machines.

📌 Prerequisites: Must run PowerShell as Administrator. Otherwise, the commands might not work.

  1. Press Win + S to open Search.
  2. Type Powershell, then right-click Windows PowerShell or Windows Terminal.
  3. Click Run as administrator.
  4. Run either of the following commands based on what you want to do. [Refer to #2 in ⚠️Things to look out for.]

To install VBScript:

Add-WindowsCapability -Online -Name "VBSCRIPT~~~~"

To uninstall VBScript: [Refer to #1 in ⚠️Things to look out for.]

Remove-WindowsCapability -Online -Name "VBSCRIPT~~~~"

To check the installation status:

Get-WindowsCapability -Online | Where-Object { $_.Name -like "VBSCRIPT" }

    • It will show something like this:

Name : VBScript~~~~0.0.1.0
State : Installed

    • Or this:

State : NotPresent

  1. Restart your PC to apply changes. [Refer to #4 in ⚠️Things to look out for.]

Method 3: Install or uninstall via DISM (Command Prompt)

📌Use Cases: Suitable for automation scripts or deployment scenarios.

📌Prerequisites: Requires Command Prompt as Administrator.

  1. Press Win + S to open Search.
  2. Type cmd, then right-click Command Prompt.
  3. Select Run as administrator.
  4. Run either of the following commands based on what you want to do: [Refer to #3 in ⚠️Things to look out for.]

To install VBScript:

DISM /Online /Add-Capability /CapabilityName:VBSCRIPT~~~~

To uninstall VBScript: [Refer to #1 in ⚠️Things to look out for.]

DISM /Online /Remove-Capability /CapabilityName:VBSCRIPT~~~~

  1. Restart your PC to apply changes. [Refer to #4 in ⚠️Things to look out for.]

⚠️ Things to look out for

Risks Potential Consequences Reversals
1. Uninstalling VBScript while legacy scripts are still in use. Critical .vbs scripts may fail without warning. It may disrupt automation or enterprise processes. Reinstall VBScript using your preferred method, and then test scripts in a non-production environment.
2. Incorrect PowerShell command. Incorrect syntax can result in failed execution or attempts. Double-check the command or use `Get-WindowsCapability -Online.
3. Force closing Command Prompt during a DISM operation. Interrupted system changes may cause incomplete installation/removal or corrupt feature states. Reboot the system and rerun the appropriate DISM command. Afterward, verify the feature status.
4. Forgetting to restart after installation or removal. Changes may not take effect. Manually restart the device to apply changes fully and confirm VBScript is functioning or disabled as intended.

Additional considerations

Here are a few additional considerations to keep in mind when working VBScript on Windows 11:

Security recommendation

VBScript has been officially deprecated, starting with Windows 11 23H2. Due to its long history of being exploited in phishing attacks and malware campaigns, Microsoft strongly recommends removing VBScript unless it’s absolutely required for compatibility.

Script testing

If you install VBScript, ensure that any existing .vbs scripts are thoroughly tested. Due to changes in Windows environments, legacy scripts may no longer function as intended. Verify behavior in a controlled test environment before using it in production.

Group Policy or Intune

VBScript can be enabled or removed programmatically using Group Policy, Microsoft Intune, or other provisioning tools. Organizations can thus automate their management as part of the system configuration or compliance baselines.

Event logging

Disabling VBScript helps reduce exposure to script-based malware, particularly those relying on phishing vectors or remote code execution. Moreover, if VBScript is being misused, suspicious activity may appear in Windows Event Logs, so enabling logging and auditing can help detect and respond to threats more effectively.

Control VBScript to maintain compatibility with legacy systems

VBScript is a deprecated feature in Windows 11, retained only for backward compatibility with legacy systems. Although no longer enabled by default, it remains an optional feature for environments that still depend on older scripts or automation tools.

Windows provides flexible installation and removal options, allowing you to support legacy workflows or enhance system security by eliminating unused components. All recommended methods require administrative privileges, and a system restart may be necessary to apply the changes fully.

Related topics:

Quick-Start Guide

NinjaOne supports various methods of installing or uninstalling software features, including VBScripts. If you need to manage VBScript, you would likely use one of NinjaOne’s scripting or automation tools:

  1. For installation or configuration, you could create a custom script in the Automation Library that enables or disables VBScript through PowerShell or Windows features management.
  2. There’s a native script in NinjaOne called “Enable Optional Windows Features on Workstations” which might be useful for managing Windows features.
  3. You can use PowerShell commands within a custom script to enable or disable VBScript functionality.

You might also like

Ready to simplify the hardest parts of IT?

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).