This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: VB script error in Cygwin


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!
   Neptune:

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]