Nov 262012
 

The Can’t Find Script Engine “VBScript” For Script… error message may occur when you try to run a program that uses VBScript – a Microsoft programming language modeled on Visual Basic. I encountered this message whilst testing a desktop shortcut which used VBScript to automatically create a system restore point.

VBScript relies upon a specific file (vbscript.dll) being present and correctly registered in Windows. We will review two possible solutions to resolve such an error – the first is to re-register the vbscript.dll file and the second is to repair a specific registry setting.

Re-register The Dll File

1. Open an elevated (admin) command prompt – both options open up a Command Prompt window:

  • XP – click Start \ All Programs \ Accessories \ Command Prompt
  • Vista/Windows 7 – click Start \ All Programs \ Accessories then right click on ‘Command Prompt’ and click on ‘Run as administrator’

2. Carefully type the following, pressing Enter after each line:

cd %windir%\system32
regsvr32 vbscript.dll

You should see a message that the operation succeeded – press OK then close the Command Prompt window.

Tip: if the operation says that vbscript.dll was not found (and you’re sure you ran the command from the system32 folder as above) then try to replace the missing vbscript.dll file by using System File Checker.

3. Run the program that uses VBScript again and see if it works – if it still produces the same Script Engine error, proceed to the next section.

Repair VBScript Language Registry Setting

Be careful when editing the registry – create a system restore point first for safety or take a backup e.g. with the Tweaking.com registry backup utility.

1. Open the Registry Editor:

  • XP – click Start \ Run and type regedit into the Run box then press OK
  • Vista/7 – click Start and type regedit into the Search box then press OK

2. In the Registry Editor, browse to the following key:

HKCR\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32

The entry called (Default) should have a value of C:\Windows\system32\vbscript.dll as shown below (ignore the Default Engine and ThreadingModel entries – you may have different ones):

vbscript3

Correct value of (Default)

However, an old/corrupt antivirus may have set the value of (Default) to something different as shown below:

vbscript4

Incorrect value of (Default) – set by old antivirus (Avast, since uninstalled)

If the value of (Default) is not correct then double click it and change its value to C:\Windows\system32\vbscript.dll and press OK.

Note: if you get an ‘Error Editing Value’ error message when you press OK, you need to change the permissions of the InprocServer32 registry key then try again.

3. Close the Registry Editor and restart the computer.

4. Run the program that uses VBScript again – if the registry setting was the cause of the error it should now work.

Why Is The Registry Change Required?

The (Default) value defines the file to be used by VBScript – by default this is vbscript.dll

Some antivirus programs change it to point to their own .dll file so they process the scripts and can check for signs of malicious behavior – a good thing.

However, this becomes a problem if the antivirus is uninstalled (so it deletes its own .dll file) but does not also change the (Default) value back to the original vbscript.dll location…

In this case, VBScript continues to look for the antivirus .dll file that no longer exists – causing the error message that it can’t be found:

vbscript1

Conclusion

There can be many causes for VBScript error messages but this particular one is often caused by a badly coded uninstall of an antivirus program.

I have seen Avast! uninstallation cause this problem and some people suggest McAfee may also be responsible – doubtless there are several others.

  23 Responses to “How To Fix The Error: Can’t Find Script Engine “VBScript” For Script”

  1. Stupid Avast after uninstalling leave a link back to scripting in the registry.

    Excellent repair instructions. Thank you!!!!!

    I gave insight “AhAScr.dll” in the Windows registry and deleted all “…….. \ Avast \ AhAScr.dll” and replaced the “C:\Windows\system32\vbscript.dll”

    Thanks for the instructions.

    Excuse my bad translation.

  2. I cant find the registry key
    “HKCR\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32”

    Can someone help me

    • @Christian – HKCR stands for HKEY_CLASSES_ROOT
      Under that folder you’ll find CLSID (need to scroll down a long way as it does NOT have a full stop before it)
      Within the CLSID folder you should find {B54F3741-5B07-11cf-A4B0-00AA004A55E8} and then the InprocServer32 key within it

  3. Perfect solution. Thank you.
    and for the record, I uninstalled McAfee before this error. so it was caused by McAfee.

  4. Hi,
    I cannot change the value on my laptop.
    A window pops up saying “Error writing
    the value’s new contents”.
    What to do? Any suggestions?
    Thanks

    • @Ralph – see the Note at the end of section 2 of Repair VBScript section above (the link in blue which says “change the permissions” of the InprocServer32 registry key.

  5. Hey Guys! The Very easy way:
    1.Open Notepad.
    2.Put in this:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32]
    @=”C:\\Windows\\system32\\vbscript.dll”
    “Default Engine”=”C:\\Windows\\system32\\vbscript.dll”
    “ThreadingModel”=”Both”

    3.Save and Exit
    4.Rename it: VBSRepair.reg – (required)
    5.Open the reg file. After that restart your pc.
    That’s it…

    Sorry for bad English 🙂

  6. Perfect, it worked properly.

    Thank you very much for the tip .

  7. I followed above steps but after that error window showing when I trying to restart ..only the userlogin done not showing anything like desktop’s file.. only the blank black sreen are showing! ! Help me what I do.. the same error displaying again n again! I also tried resetting my lapy but problem nt solved

 Leave a Reply

(required)

(required but will NOT be published)