Restoring .vbs (VBScript Script File) File Associations
“I am running Windows XP. I need to execute VBS scripts to run functions in other programs. I had no problem until some security program disabled execution of VBS Scripts. Now all I get is code Notepad and the VBS Scripts don’t execute. How do I get Windows to execute VBS Scripts again?”
Peter, if double clicking your VBS files results in them opening in Notepad, your security application has disabled VBS execution by changing the default application used to open the VBS file. In Windows, this is managed by File Associations. Let’s take a look at how to restore the default VBS File Associations.
You can restore the default application used to Open a file by changing it’s file association. If you open My Computer and choose Folder Options… from the Tools menu, you can find file association on the File Types tab.
Since the VBS file will open in Notepad, the file type is still registered on your system. Scroll through the list of file types until you find the VBS (VBScript Script File) entry. Select it and press the Advanced button.
The Edit File Type dialog box will appear. Here you can edit any of the various file associations for a given file type. In this case, we want to change the application used to Open a file. Select Open in the action list and press the Edit… button.
In the Application used to perform action: field, enter the following command line:
C:\WINDOWS\System32\WScript.exe “%1″ %*
Tick the checkbox marked Use DDE and enter the word WScript in the Application field and System in the Topic field. Now click Ok to close all open dialogs.
If you want to restore all of the default actions for the VBS file type, you can import the following .REG file.
FixVBSFileAssociationsXP.reg Windows XP only!
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.vbs] @="VBSFile" [HKEY_CLASSES_ROOT\.vbs\PersistentHandler] @="{5e941d80-bf96-11cd-b579-08002b30bfeb}" [HKEY_CLASSES_ROOT\VBSFile] @="VBScript Script File" "FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\ 00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\ 32,00,5c,00,77,00,73,00,68,00,65,00,78,00,74,00,2e,00,64,00,6c,00,6c,00,2c,\ 00,2d,00,34,00,38,00,30,00,32,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\DefaultIcon] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,53,00,\ 63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,2c,00,32,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\ScriptEngine] @="VBScript" [HKEY_CLASSES_ROOT\VBSFile\ScriptHostEncode] @="{85131631-480C-11D2-B1F9-00C04F86C324}" [HKEY_CLASSES_ROOT\VBSFile\Shell] [HKEY_CLASSES_ROOT\VBSFile\Shell\Edit] @="&Edit" [HKEY_CLASSES_ROOT\VBSFile\Shell\Edit\Command] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,6f,00,\ 74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,25,00,31,00,00,\ 00 [HKEY_CLASSES_ROOT\VBSFile\Shell\Open] @="&Open" [HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,53,00,\ 63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,31,\ 00,22,00,20,00,25,00,2a,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\Shell\Open2] @="Open &with Command Prompt" [HKEY_CLASSES_ROOT\VBSFile\Shell\Open2\Command] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,43,00,53,00,\ 63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,31,\ 00,22,00,20,00,25,00,2a,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\Shell\Print] @="&Print" [HKEY_CLASSES_ROOT\VBSFile\Shell\Print\Command] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,6f,00,\ 74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,70,00,20,\ 00,25,00,31,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\ShellEx] [HKEY_CLASSES_ROOT\VBSFile\ShellEx\DropHandler] @="{60254CA5-953B-11CF-8C96-00AA00B8708C}" [HKEY_CLASSES_ROOT\VBSFile\ShellEx\PropertySheetHandlers] [HKEY_CLASSES_ROOT\VBSFile\ShellEx\PropertySheetHandlers\WSHProps] @="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
On Windows Vista systems, you should use the following .reg file instead.
FixVBSFileAssociationsVista.reg Windows Vista and Windows 7 only!
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.VBS] @="VBSFile" [HKEY_CLASSES_ROOT\.VBS\PersistentHandler] @="{5e941d80-bf96-11cd-b579-08002b30bfeb}" [HKEY_CLASSES_ROOT\VBScript] @="VB Script Language" [HKEY_CLASSES_ROOT\VBScript\CLSID] @="{B54F3741-5B07-11cf-A4B0-00AA004A55E8}" [HKEY_CLASSES_ROOT\VBScript\OLEScript] [HKEY_CLASSES_ROOT\VBSFile] "FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\ 00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\ 32,00,5c,00,77,00,73,00,68,00,65,00,78,00,74,00,2e,00,64,00,6c,00,6c,00,2c,\ 00,2d,00,34,00,38,00,30,00,32,00,00,00 @="VBScript Script File" [HKEY_CLASSES_ROOT\VBSFile\DefaultIcon] @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\ 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,53,00,\ 63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,2c,00,32,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\ScriptEngine] @="VBScript" [HKEY_CLASSES_ROOT\VBSFile\ScriptHostEncode] @="{85131631-480C-11D2-B1F9-00C04F86C324}" [HKEY_CLASSES_ROOT\VBSFile\Shell] @="Open" [HKEY_CLASSES_ROOT\VBSFile\Shell\Edit] [HKEY_CLASSES_ROOT\VBSFile\Shell\Edit\Command] @=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\ 00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,\ 6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,22,00,20,00,25,\ 00,31,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\Shell\Open] [HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command] @=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\ 00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,\ 53,00,63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,22,\ 00,25,00,31,00,22,00,20,00,25,00,2a,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\Shell\Open2] @=hex(2):4f,00,70,00,65,00,6e,00,20,00,26,00,77,00,69,00,74,00,68,00,20,00,43,\ 00,6f,00,6d,00,6d,00,61,00,6e,00,64,00,20,00,50,00,72,00,6f,00,6d,00,70,00,\ 74,00,00,00 "MUIVerb"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\ 6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\ 00,77,00,73,00,68,00,65,00,78,00,74,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,\ 34,00,35,00,31,00,31,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\Shell\Open2\Command] @=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\ 00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,43,00,\ 53,00,63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,22,\ 00,25,00,31,00,22,00,20,00,25,00,2a,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\Shell\Print] [HKEY_CLASSES_ROOT\VBSFile\Shell\Print\Command] @=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\ 00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,\ 6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,22,00,20,00,2f,\ 00,70,00,20,00,25,00,31,00,00,00 [HKEY_CLASSES_ROOT\VBSFile\ShellEx] [HKEY_CLASSES_ROOT\VBSFile\ShellEx\DropHandler] @="{60254CA5-953B-11CF-8C96-00AA00B8708C}" [HKEY_CLASSES_ROOT\VBSFile\ShellEx\PropertySheetHandlers] [HKEY_CLASSES_ROOT\VBSFile\ShellEx\PropertySheetHandlers\WSHProps] @="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
You may also download the .reg files here.
FixVBSFileAssociationsVista.reg





























July 9th, 2009 at 6:36 pm
Followed instructions. Tried to run a VBS Script and got the following error message:
Windows Script Host
There is no script engine for file extension “.vbs”"
The clicked to download the fix for XP that you provided but when I ran it, I just got a few lines of code in Notepad and the reg file didn’t run.
Help
July 9th, 2009 at 8:12 pm
Hello Peter.
It sounds as though your .reg file type has been changed as well. This is somewhat common since some administrators will disable the ability to import registry changes.
You can try importing the registry file from the command line and see if that works. Open a Command Prompt window and navigate to the folder where you saved the .reg file that you downloaded. It can be imported using REGEDIT from the command line.
You can repair your .reg file associations with one of the files below. You’ll likely need to import it as I’ve shown you above.
FixREGFileAssociationsXP.reg
FixREGFileAssociationsVista.reg
As for your error message, see my post “There is no script engine for file extension” error when opening .vbs files.
July 12th, 2009 at 7:03 pm
[…] Restoring .vbs (VBScript Script File) File Associations in Windows … […]
July 22nd, 2009 at 2:34 am
Worked like a charms! Thank you very much!
January 10th, 2010 at 3:07 am
ke tal , oye mi problema es ke ami me cambio toda mi musica . todo la musica la tenia en mp3 y con este archivo vbs meecho a perder mi musica y es inportante para mi , como le hago para recuperarla y ke se vuelvan hacer en mp3. graciass y ojala me haya explicado, gracias, tengo windows xp.