Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows 7 has no script engine for file extension ".vbs"

Status
Not open for further replies.

OfficeAnimal

Technical User
Jun 4, 2009
277
AU
I have just installed PrimalScript 2015 and written this very complex script file:

'==============================
Option Explicit
On Error Resume Next
Dim My_Message

My_Message = "Hello World"
MsgBox My_Message
'==============================

When I try to run this I get:

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Input Error: There is no script engine for file extension ".vbs".
Execution time: < 1 second
Exit code: 1 , 0001h

[banghead] I have read a dozen solutions on the Net dating from the turn of the century.
It seems to be a problem no-one complains about these days.
Just the same, it happened to me! [banghead]

What does one do these days?

"Truth will sooner come out from error than from confusion."
Francis Bacon (1561-1626)
 
How are you running your script? By double-clicking the .vbs file, or some other way?

A quick search points to .VBS files not being accociated with the right program. Do a right-click over your script and choose "Open With...". The first option should be Microsoft Windows Based Script Host. Is it set to something else?
 
I have tried the double-click way and also by running in the IDE (PrimalScript 2015). No luck!

FTR: These are the extra software options I get to open the file
VBScript_Host_Options_vxuuh5.jpg


If I run 'assoc' on a command line as administrator I get the line ".vbs=VBSFile".


"Truth will sooner come out from error than from confusion."
Francis Bacon (1561-1626)
 
Certainly looks like a deeply routed association problem (rather than a superficial one). Try the vbs reg fix file found linked here (site claims this is just for W7, but should work for W8/8.1 as well; don't know for certain about W10).

This may disassociate PrimalScript, though.
 
For the record:

[flip] I now have a system which is running VBScript. [flip]

What did it for me?

1. From command line (run as administrator) "regsvr32 %systemroot%\system32\vbscript.dll"
2. Locate "%windir%\inf\wsh.inf (on Windows 7 this equates to C:\Windows\inf\wsh.inf")
--> right click --> Install
3. If you don't have wsh.inf (as I didn't) download a copy to the appropriate folder and proceed.


My thanks again to those who offered assistance.
Hope this helps some other poor soul [bugeyed]

"Truth will sooner come out from error than from confusion."
Francis Bacon (1561-1626)
 
You can run it with either cscript or wscript. Depends on whether you want a message box on every WScript.echo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top