Restoring .vbs (VBScript Script File) File Associations

July 9th, 2009

“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 A.

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.

FixVBSFileAssociationsXP.reg

FixVBSFileAssociationsVista.reg

Please use the trackback link when linking to this post.

Related Posts:

Add to Technorati Favorites

5 Responses to “Restoring .vbs (VBScript Script File) File Associations”

  1. Peter A Says:

    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

  2. Nilpo Says:

    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.

    regedit FixVBSFileAssociationsXP.reg

    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.

  3. Radar Detector Valentine One vs Whistler Pro 78 REV C - Rear Set-up 6F - Walter RD east. | Radar Detector Online Directory Says:

    […] R&#101storin&#103 .vbs (VB&#83cript &#83cript Fil&#101) Fil&#101 Associations in &#87indows … […]

  4. Structed Says:

    Worked like a charms! Thank you very much!

  5. toño Says:

    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.

Leave a Reply

.htaccess Apache article articles by Nilpo ASP ASP Free automation clipboard desktop Dev Shed docx drive Internet Explorer Microsoft PHP registry remove script scripting text tutorial tweak tweets Twitter UAC updates User Account Control VBS VBScript vista volume Windows Windows 7 Windows 2000 Windows Guru Windows Script Windows Script Host Windows Scripting Windows Vista Windows XP Word WScript wscript.exe WSH XP