views:

2327

answers:

6

After installing the new server, I am facing an issue.

I have lot of .vbs files, all need to run in wscript, reason, I use all those command like WScript.Echo "hello"

I want to be able to see the output when I double click the VBScript file.

But when I right click on the vbs file, I see console, I want to change the default to Windows host, globally!

How can I do that?

+1  A: 

Check the Windows Explorer settings for the filetype *.vbs (something like tools->options->file types etc.) and change the "open with" setting to cscript.

Daren Thomas
+10  A: 

You can change the default scripting host to wscript.exe like so:

wscript.exe //H:wscript

If you wish to set cscript as the default host, that works in the same way:

wscript.exe //H:cscript

You can execute cscript.exe with the same arguments for the same result.

Fredrik Mörk
+2  A: 

You can switch the default script engine with:

wscript //H:Wscript

Good luck!

Sergius
+2  A: 

I was able to solve it by using the following steps:

  1. selecting the VBScript file that I want to open,
  2. right click to select default program for this,
  3. browse to C:/windows/windows32/wscript.exe, and select this.
i need help
+1  A: 

The guy above who right-clicked to choose the default program was right, however the path should be: C:\Windows\System32\wscript.exe

Steve
A: 

Need to say thanks to Peter Mortensen. I have searched a lot on web on how my VBScript to run Wscript instead of Cscript. Because whenver i run the VBScript using CScript it opens a Command Console which i wanted to get rid Off. Thanks a lot Peter

--Vijay

Vijay