VBS file

How can I run VBS file I windows 10? By default it's opening in Notepad. Running with wscript I get error "There is no script engine for file extension .vbs".
LVL 7
8046586Asked:
Who is Participating?
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
This site works best when you work with us and communicate what is happening.
0
 
Tom CieslikIT EngineerCommented:
You can run scripts with the Windows-based script host in the following ways:
By browsing in Windows
Browse to the folder containing the script you want to run and double-click it. Script files can be listed in My Computer, Windows Explorer, the Find window, the Start menu, or on your desktop.
By using the Run command
Click Start, and then click Run. In Open, type the name of the Windows Host executable file (Wscript.exe), followed by a space, then the full path name of the script you want to run. Be sure to include the file name extension of the script file. Click OK to start the script.
From a command prompt window
At the command prompt, type the name of the Windows Host executable file (Wscript.exe), followed by a space, then the full path name of the script you want to run. Be sure to include the file name extension of the script file. Press Enter to start the script.

for example

RUN/SEARCH

Wscript.exe  script.VBS
0
 
8046586Author Commented:
Hi Tom, I tried to sublimate your explanation in one sentence in my question. I am doing exactly the same you say and it pops up an error.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
NVITCommented:
Is your antivirus possibly blocking it?
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
so whats the error? post a screen shot.

you can also run cscript to execute from a command line - cscript yourscript.vbs
0
 
Tom CieslikIT EngineerCommented:
Turn OFF you antivirus for second and try again.
0
 
8046586Author Commented:
Antivirus off. cscript or wscript is the same error message. RUN and CMD
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
What happens when you run WSCRIPT or CSCRIPT with NO script specified?
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Let’s follow these methods & check if the issue persists:

Method 1
a. Type ‘cmd’ in Start, Run box. Right click on cmd in the Program list and then select the option Run as Administrator.
b. Type the following command, and then press ENTER on the keyboard:
cscript.exe //H:WScript

Method 2

You may re-register the vbscript.dll file:
a. Type ‘cmd’ in the Start, Run box, right-click on Command Prompt, click on Run as Administrator.
b. Type ‘Regsvr32 <space> vbscript.dll’.
c. Click the OK button.

Above from https://answers.microsoft.com/en-us/windows/forum/windows_xp-performance/error-there-is-no-script-engine-for-file-extension/ef023588-0c5c-4d37-a169-20eedb9c5a4c?auth=1
0
 
Tom CieslikIT EngineerCommented:
“wscript.exe” is Windows Script Host which is a default program to open “.vbs” file types.

Let’s follow these methods & check if the issue persists:

Method 1
a. Type ‘cmd’ in Start, Run box. Right click on cmd in the Program list and then select the option Run as Administrator.
b. Type the following command, and then press ENTER on the keyboard:
cscript.exe //H:WScript

Method 2

You may re-register the vbscript.dll file:
a. Type ‘cmd’ in the Start, Run box, right-click on Command Prompt, click on Run as Administrator.
b. Type ‘Regsvr32 <space> vbscript.dll’.
c. Click the OK button.

Another solution might be to reassociate the vbs files with the following command:
assoc .vbs=VBSFile

Hope the information helps.
0
 
Isha RIkhiData Recovery ExpertCommented:
Hi Nick if you are still facing the issue then follow the steps mentioned below.I have read it in some community and resolved the same issue faced by me a few days back-
"You can run scripts with the Windows-based script host in the following ways:
By browsing in Windows
Browse to the folder containing the script you want to run and double-click it. Script files can be listed in My Computer, Windows Explorer, the Find window, the Start menu, or on your desktop.
By using the Run command
Click Start, and then click Run. In Open, type the name of the Windows Host executable file (Wscript.exe), followed by a space, then the full path name of the script you want to run. Be sure to include the file name extension of the script file. Click OK to start the script.
From a command prompt window
At the command prompt, type the name of the Windows Host executable file (Wscript.exe), followed by a space, then the full path name of the script you want to run. Be sure to include the file name extension of the script file. Press Enter to start the script.
"
0
 
8046586Author Commented:
Unfortunately, nothing of the above solutions works for me. Wnem I am trying to associate the file type .vbs with wscript.exe I am getting another error "The program you have selected cannot be associated with this file type. Please choose another program."
0
 
8046586Author Commented:
I found a workaround to run the VBS files, but the solution probably is windows reinstallation.

Workaround:
Run CMD as Administrator

C:\windows:\system32>wscript.exe //E:vbscript <file location\file name.vbs>

Thanks everyone for your support.
0
 
8046586Author Commented:
Problem solved
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.