X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Andrew DeFaria Subject: Re: VB script error in Cygwin Date: Thu, 26 Jul 2012 07:43:02 -0700 Lines: 49 Message-ID: References: <1343201120 DOT 87444 DOT YahooMailNeo AT web162104 DOT mail DOT bf1 DOT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 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