Skip to content

Est. 2011ยทMicrosoft Partner 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix 2738

MSI 2738 and 2739: Could Not Access VBScript or JScript Runtime in Setup

11 min read Updated October 5, 2026 Installers, Runtimes & App Deployment

Fix it now

Windows Installer asked COM for a script engine so it could run a custom action, and did not get one. Microsoft’s message for 2738 is that the VBScript run time could not be accessed; 2739 says the same about JScript. The engine is either shadowed by a class registration in your own user hive or not registered machine-wide.

Run these in an elevated Command Prompt, in order

reg query HKCU\SOFTWARE\Classes\CLSID /s /f vbscript.dll
reg query HKCU\SOFTWARE\Classes\CLSID /s /f jscript.dll
regsvr32 %windir%\System32\vbscript.dll
regsvr32 %windir%\System32\jscript.dll
%windir%\SysWOW64\regsvr32.exe %windir%\SysWOW64\vbscript.dll
  1. Read the two reg query results first. Any hit means a class registration in your own hive is pointing at the engine, and that copy is used in preference to the machine-wide one.
  2. Export each key it found before you touch it, then delete it: reg export "<key>" %USERPROFILE%\Desktop\clsid.reg followed by reg delete "<key>" /f. Sign out and back in.
  3. Run the install again with a log and search the log for the error number: msiexec /i "C:\pkg\app.msi" /l*v "C:\pkg\install.log".

The last line covers 32-bit installers on 64-bit Windows, which resolve against the SysWOW64 copies of both the engine and regsvr32. Registering the 64-bit copy does nothing for them.

If setup now gets past the custom action you are done. If not, the next section explains how COM picks an engine and which of the five causes you are looking at.

Why it happens

A scripted custom action does not run a file. It asks COM to create a script engine by class identifier, hands it the script text, and waits. Everything before that point in the installation is unaffected, which is why the error lands mid-transaction and the whole thing rolls back looking like a damaged package.

COM resolves a class identifier through a merged view: registrations in the user’s own hive are read in preference to the machine-wide ones, so that software can register a class for one account without affecting others. That ordering is the reason this failure is so common. One stray key under your classes takes priority over a perfectly good machine registration, and if it points at a file that is missing, renamed or quarantined, the engine cannot be created. Because that key belongs to a profile, the same package usually installs without complaint under a different account on the same machine, which is the cheapest confirmation of the diagnosis you will get.

The neighbouring numbers describe adjacent failures rather than the same one. 1720 and 2740 both report a script that ran and then broke, and both carry the custom action name, the script error and a line and column – a packaging fault rather than a machine one. 2869 is not about scripting at all: Microsoft publishes it as a dialog in the package that has the error style bit set without being an error dialog.

A class registration in your own hive is shadowing the engine

You have this one if One of the reg query commands returns a key, or the same package installs cleanly under a different account on the same machine.

  1. Export the key it found, then delete it so COM falls back to the machine-wide registration.
  2. Check the 32-bit view as well on 64-bit Windows: reg query HKCU\SOFTWARE\Classes\Wow6432Node\CLSID /s /f vbscript.dll.
  3. Sign out and back in so class registrations are re-read, then run the installer again.

Delete only the keys the query returned. Working from a GUID somebody posted online is how people remove the wrong class and stop unrelated software from starting.

The engines are not registered machine-wide

You have this one if Every account fails, including one you have just created, and re-registering changes the outcome.

  1. From an elevated Command Prompt run regsvr32 %windir%\System32\vbscript.dll and the same for jscript.dll.
  2. Repeat with the SysWOW64 copies so 32-bit installers are covered.
  3. If registration itself fails, run sfc /scannow and then DISM /Online /Cleanup-Image /RestoreHealth, and try again.

Microsoft has deprecated VBScript. The published position is that it will be offered as a feature on demand in future Windows releases before it is removed, so on a new enough build check whether the component is present at all before treating an absent file as corruption.

Script execution is being blocked rather than failing

You have this one if Registration succeeds, the file is present and correct, and the custom action still fails – usually with an entry in the endpoint product’s log at the same second.

  1. Check whether Windows Script Host has been switched off for the machine or the user, and remove the setting if nobody set it deliberately.
  2. Exclude the deployment staging folder in your endpoint policy rather than the whole disk, and review any script-blocking rule.
  3. Pause real-time protection once to confirm the diagnosis, then turn it back on and write the exclusion properly.

The failure is 2869, which is not a scripting problem at all

You have this one if The log shows 2869 rather than 2738 or 2739, usually on an older package.

  1. Run the package from an elevated Command Prompt, or quietly with /qn, so the dialog it cannot display is never shown.
  2. If the package is yours, correct the entry in its Dialog table rather than working around it on every machine.

Elevation is a workaround here, not a fix. The package is asking the installer to display a dialog flagged as an error dialog when it is not one.

The script itself is failing

You have this one if 1720 or 2740 in the log, with a custom action name, a script error and a line and column number.

  1. Read that entry: it names the action and the position in the script that failed, and the position means something to the vendor.
  2. Check what a script commonly assumes: a service that can start, a folder it can write to, a network resource it expects to reach.

Full reference

What Microsoft publishes for each number

Number Published message
2738 Could not access VBScript run time for custom action [2].
2739 Could not access JScript run time for custom action [2].
1720 A script required for this install to complete could not be run. Custom action [2] script error [3], [4]: [5] Line [6], Column [7], [8]
2740 Custom action [2] script error [3], [4]: [5] Line [6], Column [7], [8]
2869 The dialog [2] has the error style bit set, but is not an error dialog.

The bracketed placeholders are filled in at run time, which is why a verbose log is worth more than the dialog on screen. msiexec /i package.msi /l*v log.txt writes every substituted value, so the custom action name and the script position arrive intact.

Finding the shadowing key without a GUID

Advice for this error usually opens with two class identifiers to delete. Microsoft does not publish those identifiers in its documentation, and typing a GUID from memory into reg delete is a good way to break something else. Search your own registry for the file name instead, which finds the same key and proves it is the right one:

reg query HKCU\SOFTWARE\Classes\CLSID /s /f vbscript.dll
reg query HKCU\SOFTWARE\Classes\CLSID /s /f jscript.dll
reg query HKCU\SOFTWARE\Classes\Wow6432Node\CLSID /s /f vbscript.dll
reg query HKLM\SOFTWARE\Classes\CLSID /s /f vbscript.dll

The last line is the control. It shows what the machine-wide registration looks like, which is what COM will use once the per-user key is gone. If the machine-wide entry points somewhere that is not %windir%\System32\vbscript.dll, that is the thing to fix, and re-registering with regsvr32 rewrites it.

Registering the right copy

Command Registers
regsvr32 %windir%\System32\vbscript.dll The 64-bit engine, used by 64-bit installers
%windir%\SysWOW64\regsvr32.exe %windir%\SysWOW64\vbscript.dll The 32-bit engine, used by 32-bit installers
regsvr32 /u <dll> Unregisters, which is worth knowing when an upgrade leaves a half-registered engine
regsvr32 /s <dll> Suppresses the message boxes, for scripted deployment

Both architectures matter more often than people expect. A 64-bit machine running a 32-bit installer resolves the class through the 32-bit view, so a perfectly registered 64-bit engine is invisible to it. Registering both costs nothing and removes the question.

Where this is heading

Microsoft’s deprecated features list records VBScript as deprecated, announced in October 2023, and states that in future releases of Windows it will be available as a feature on demand before it is removed from the operating system. That has two practical consequences. On a machine where the component has not been added, the file genuinely is absent and no amount of re-registering will help. And if you author packages, a scripted custom action is now a dependency with an end date.

  • Prefer standard actions where the installer already has one for the job.
  • Where you need code, a compiled custom action has no engine to resolve and no per-user class registration to be shadowed by.
  • If you must keep script actions, make them fail with a message rather than an unhandled error, so the log shows something better than a line and column number.
  • Test the package under a second, freshly created account. That is where per-user shadowing shows up.

When none of the above applies

  1. Check whether the install works from the built-in Administrator account. If it does, the difference is in your profile, and it is almost always a class registration.
  2. Look at the log for the action immediately before the first Return value 3. That is the action that failed, and on a scripted action it will be named.
  3. Confirm the engine files exist and are the size they should be, then re-register them and read what regsvr32 reports rather than assuming it worked.
  4. If the machine has had a script-based infection cleaned off it, expect leftovers in the class registrations and check both the 64-bit and 32-bit views.

Every code this article covers

Code What it points at Source
2738 The VBScript run time could not be accessed for a custom action Microsoft Learn
2739 The JScript run time could not be accessed for a custom action Microsoft Learn
2869 A dialog in the package has the error style bit set but is not an error dialog Microsoft Learn
1720 A script required for the installation could not be run; the message carries the custom action, the script error and the line and column Microsoft Learn
2740 A script custom action failed inside the script, with the same line and column detail Microsoft Learn

Confirm the fix worked

  1. Run the installer again with /l*v and confirm the custom action completes instead of returning a failure.
  2. Re-run the two reg query commands and confirm no per-user class registration has come back.
  3. Confirm the product appears in Settings, Apps, Installed apps and starts.
  4. Install a second package that uses scripted actions, so you know the engine is healthy generally rather than for one product.
  5. Sign out and back in, then check once more, which rules out a profile tool recreating the key at logon.

Questions people ask about this

Does fixing 2738 cost anything?

No. Everything here is registry housekeeping and re-registering components that ship with Windows. There is no licence state involved in a script engine failing to load, and nothing to buy.

Is it safe to delete the class key under my own hive?

In the normal case, yes: deleting it makes COM fall back to the machine-wide registration, which is what should have been used all along. Export it first, and delete only the key your own reg query returned rather than a GUID from a forum post.

Why does the same installer work for one user and not another?

Because class registrations in a user’s own hive are read in preference to the machine-wide ones. That difference between accounts is the strongest confirmation you will get that a per-user key is the cause.

I see 2869 instead. Is that the same problem?

No. Microsoft publishes 2869 as a dialog in the package that has the error style bit set without being an error dialog. Running the package elevated or quietly gets you past it, but the fault is in the package’s Dialog table and only the author can fix it properly.

Should new packages still use script custom actions?

Increasingly not. Scripted actions depend on an engine that endpoint tooling restricts, they are vulnerable to per-user class registrations, and Microsoft has VBScript on a deprecation path towards removal. Standard actions or compiled custom actions avoid all three.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

License Error 0x803F8001: This App Is Not Licensed for Your Account or This Device Free Fix Error 2502 and 2503: Called RunScript When Not Marked in Progress on Install Free Fix MSI 1904 and 1920: Module Failed to Register or Service Failed to Start Free Fix 0x800C0006: .NET Web Installer and ClickOnce Downloads Fail Part-Way
โ† Back to Knowledge Base