What, VBscript deprecated?
VBScript (“Microsoft Visual Basic Scripting Edition”) is a
scripting language developed by Microsoft.
Feature On Demand are Windows features that allow you to enable
and disable additional functionality for your devices at any time. On
Windows 11, you can access these features by navigating to Settings ->
Apps -> Optional features.
The reason why Microsoft is deprecating VBScript is because it’s a legacy scripting engine component that Microsoft does not recommend using unless it’s absolutely necessary, as it may contain security vulnerabilities.
The exact date when the VBScript feature will be completely disabled by Microsoft has not been revealed yet.
What is the impact?
VBScript is frequently used by organization in-house development teams for automating tasks and creating utility tools, as well as by Windows operating system administrators. While the industry standard for most tasks has shifted away from VBScript to languages like PowerShell and other scripting languages, there are still cases where VBScript remains widely used.
In application management, Microsoft Installer (MSI) capabilities often fall short of making the necessary changes when deploying application packages in an enterprise environment. Therefore, IT system administrators and application packagers utilize VBScript, either for MSI Custom Actions or as a separate file, to implement the required changes during package installation or uninstallation.
When installing MSI without VBScript feature the MSI will fail with the following error:
“The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2738.”
When reading the MSI log file you will find the following error message:
“Error 2738: Could not access VBScript runtime for custom action”
Another scenario where IT system administrators rely on VBScript is when they need to run PowerShell scripts in a user’s context without triggering any pop-ups. Running a PowerShell script in a user’s context can result in opening and closing PowerShell windows, which can be disruptive and annoying for end users. As a solution, enterprise administrators turn to VBScript to launch the PowerShell script.
How to Prepare to Work Without VBScript?
Please note that at the time this blog post is written, it is still possible to use VBScript as an optional feature in the Windows OS. However, Microsoft’s official announcement of VBScript deprecation due to security reasons is a strong indicator that, in future Windows releases, VBScript may no longer be available. This could potentially disrupt organizations relying on this solution, causing issues and making things to not work as expected.
The exact timing of this change is currently unknown, as well as the specific files and libraries that will be removed from the Windows Operating System with VBScript feature removal. Therefore, it is a good idea to prepare your environment to not rely on deprecated Windows features.
Here are the steps we recommend organizations consider taking to prepare for a transition away from VBScript usage in their environment:
- Identify in-house developed applications that use VBScript and find suitable replacements, such as PowerShell or another programming language.
- Assess third-party applications in your environment that may rely on VBScript, starting with older applications that are no longer actively developed.
- Determine which MSI packages have VBScript Custom Actions or contain .vbs files in it, and replace them with PowerShell scripts or contact the vendor to make necessary adjustments.
Tools that can help
Here is a list of tools and descriptions that can assist you in transitioning away from using VBScript:
Replace VBScript with PowerShell. Explore whether there might be an even better alternative to your current VBScript solution, such as Python.
For System Administrators, you may encounter situations where you need to run PowerShell .ps1 scripts silently without any pop-ups, a feature not currently supported by PowerShell. Ironically, some IT system administrators have used VBScript as a workaround to execute PowerShell scripts, but this is not a viable long-term solution due to the fact VBScript is being deprecated. For further discussion on this topic, you can refer to this thread on X where industry experts discuss different options on how to overcome this issue.
Master Packager – detect VBS in MSI/MST
When working with MSI files use Master Packager to open, create, and edit MSI/MST files. Starting with version 23.6.8717 Master Packager will detect if the MSI has VBScript Custom Actions. This functionality is supported in the Free Community Version.
We believe that a feature like this is a crucial functionality to be proactive and prevent issues going forward. If you use ORCA or InstEd to edit MSI files, then you will love working with Master Packager even more.
Master Packager – Run PowerShell script with MSI
With Master Packager Professional you can run a PowerShell script within an MSI or MST file and it takes just a few clicks.
- PowerShell is executed silently without any Window flickers.
- PowerShell error logging is handled in the MSI log file
- PowerShell script is working during Intune and SCCM system context deployments
We have made sure that adding and running PowerShell scripts with Master Packager in MSI or MST is easy as possible. Here is how to add PowerShell in an MSI with a 6 simple clicks:
- In Master Packager Advanced Editor got to Custom Actions
- Choose Predefined Actions
- Press Add New Predefined Action
- Select Run PowerShell Script
- Press Add
- Browse PowerShell .PS1 file or Edit it in the software
VBScript-Remediation by Dan Gough
To understand which of your current MSI/MST files has VBScript Custom Actions or .vbs files in the file table you want to check out these VBScript-Remediation script created by awesome Dan Gough). This comes very handy to validate multiple MSI and MST files.
It is available for free under MIT license.
VBScript is a feature that is being deprecated due to security reasons and starting with Windows 11 23H2 is available as Feature On Demand. It is unknown when it will be removed completely therefore it is smart to prepare organizations and the software that use this previously widely used solution and replace it with other tools. It comes in handy to know tools like Master Packager that can help organizations and software developers to understand where VBScript is currently used.