VB script error in Cygwin

Andrew DeFaria Andrew@DeFaria.com
Thu Jul 26 14:43:00 GMT 2012

On 07/26/2012 07:24 AM, Keith Christian wrote:
> I usually write a CMD.EXE script that in turn, runs cscript and its *.vbs file.
> Example:
> The following lines are a cmd "batch" file called bar.cmd
> 	@echo on
> 	echo.This is "bar.cmd," a CMD.EXE script, which will be invoked by Cygwin
> 	echo.Run a vbscript called "foo.vbs"
> 	cscript foo.vbs
> 	echo."foo.vbs" is complete
> 	echo.Done, now exiting "bar.cmd"
> 	exit
> ** First ** ---- run bar.cmd within a CMD.EXE window to be sure it and
> foo.vbs are working properly outside of Cygwin.
> ** Second** ---- from within Cygwin's bash (or other) shell, run bar.cmd:
> $ cmd /c bar.cmd
> Watch for output or results from "foo.vbs" during the run.
> ========== Keith
There's no need to interject a needless additional process of cmd.exe. 
You can call cscript directly without a problem:

    Neptune:cat HelloWorld.vbs
    option explicit

    sub display (msg)
       wscript.echo msg
    end sub

    display "Hello World from VBS!"
    Neptune:cscript HelloWorld.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    Hello World from VBS!

Andrew DeFaria <http://defaria.com>
I put instant coffee in my microwave oven and almost went back in time.

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list