[Fix] VBScript Files Open With Notepad

When you try to run a VBScript by double-clicking it, the script may open in Notepad. This happens if the user has set Notepad as the default (instead of wscript.exe) program for .vbs files, using Open with or through any other methods..

vbs files open in notepad

[Fix] VBScript Files Open With Notepad

Running VBScript manually

To run the script, you may use one of these two Windows Script Host executables.

  • CScript.exe (Console-based Scripting Host)
  • WScript.exe (Windows-based Scripting Host)

Whether you use WScript or CScript, you still run the scripts in the same manner. The difference is only in the output — WScript generates windowed output, while CScript sends its output to the command window in which it was started. (REF: Running Scripts from Windows)

To run a VBScript file using CScript.exe, use the following command-line syntax:

cscript.exe "drive:\path\filename.vbs"

To run a VBScript file using WScript.exe, use the following command-line syntax:



wscript.exe "drive:\path\filename.vbs"

Fix the Default “Open” Action for VBScripts

To reset the default action for .vbs file types so that double-clicking executes the file instead of opening it in Notepad, use these steps:

Download vbsfix.zip and save to Desktop. Unzip and run the enclosed REG file vbsfix_vista.reg by double-clicking it. Click Yes when asked for confirmation.

This changes the default action for .vbs files associating them with Windows Scripting Host executable.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

7 thoughts on “[Fix] VBScript Files Open With Notepad”

  1. Thanks a lot!
    It took me some time to find this site and your answer to a problem that has bugged me for over a week. But your solution worked!
    Thanks again,
    Gunnar

    Reply

Leave a Comment