delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/03/21/00:14:11

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT com>
Subject: Re: invoke vbscript from cygwin?
Date: Thu, 20 Mar 2008 22:12:58 -0700
Lines: 75
Message-ID: <frvg4s$mkv$1@ger.gmane.org>
References: <943be0b10803191523g2bba03cck7e17832dc56958ca AT mail DOT gmail DOT com> <23fce8e60803191549u7c26de6bo2d41e95aa9a419ae AT mail DOT gmail DOT com> <943be0b10803191618u7668057cmf142fd2bd15359f2 AT mail DOT gmail DOT com> <47E1A685 DOT B9A089E8 AT dessent DOT net> <943be0b10803192227ibab3bbbmf1161ffb14f10557 AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
In-Reply-To: <943be0b10803192227ibab3bbbmf1161ffb14f10557@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Dave Burns wrote:
> On Wed, Mar 19, 2008 at 1:49 PM, Brian Dessent <brian AT dessent DOT net> wrote:
>> Dave Burns wrote:
>>
>> > Yes, that worked splendidly. Should I have known about these
>> > executables? Are they the regular interpreters for vbscripts? I know
>> > little about cygwin and nothing about vbscript, and I did not see
>> > these mentioned in the documentation.
>>
>> The Cygwin documentation? Why would they be there?
> That's my point. Previous poster seemed to think it should be obvious, 
> but I was just skimming the cygwin docs, which have no reason to 
> mention them.
It's not really a far stretch to assume that since you were asking about 
how to run a vbscript from cygwin that you were at least knowledgeable 
about vbscript, how it's just a scripting language and how underlying it 
is either wscript or cscript which is the engine/interpreter program 
which consumes the vbscript code and executes its desired function. I 
mean how are we to know that you are naive about vbscript too? Of 
course, we also assume you do at least a little bit of your own homework 
first and have made a good faith attempt at figuring out your own 
problem before bothering others to solve your problem. Or, at least 
that's what I try to do.
>> The Windows Script Host is
>> documented by MS on MSDN though:
>> <http://msdn2.microsoft.com/en-us/library/ey73d9d3(VS.85).aspx>
> What's that? If we'd never had this conversation, I'd never have 
> followed that link as a clue to solve this problem.
That link's probably a clue to understanding that vbscript isn't magic 
and that it relies on good old executables like wscript.exe and 
cscript.exe to run.
>> > Maybe I was too hasty, but I
>> > didn't even see "Here's how you invoke a regular windows .exe from
>> > within cygwin". I'm sorry for mystifying you - someone handed me an
>>
>> There's no fundamental difference between running a Cygwin command 
>> and a non-Cygwin command from a shell prompt, in the end it's just an 
>> .exe
>> either way: you type its name and the shell runs it if it can find it in
>> the PATH.
> This is useful to know. It seems non-obvious to me, as a newbie-ish 
> user of cygwin. Maybe I was just having brain-hiccup. Not clear where 
> to put it in the docs, if someone wanted to make it more obvious. 
> Maybe it is obvious enough already.
Yes it is. As was said, Cygwin executables are no different than Windows 
executables - IOW executables are executables. That said, why would you 
expect Cygwin to explain how you run non-Cygwin stuff? You're expected 
to know that stuff on your own or at least seek out the owners/writers 
of that other stuff to understand how it runs.
> Short review - to run a script from cygwin, find the exe that is the 
> interpreter of the script (in the case of vb script, cscript.exe or 
> wscript.exe) and invoke the interpreter with the script as an argument.
Provided that the script requires an .exe interpreter to run and that 
the interpreter expectx to see the script as a parameter. Now, most do. 
But some might not. For example, PowerBuilder may totally ignore your 
PowerBuilder script (is PowerBuilder a scripting type language? I don't 
know) on the command line and instead bring up the PowerBuilder IDE 
insisting or assuming that you then run it from within the PowerBuilder 
GUI. IOW it depends on the app. Ask them how you execute them from a 
command line. They will probably tell you how to do it from a cmd 
command line. Translate that to Cygwin. You're good to go.

Another, real life example, but from the Unix world, is what I'm working 
on right now. Testers write test "scripts" in a GUI with drawing 
flowcharts and the like. I'm expected to run their tests "from the 
command line". The command that ultimately "runs the 'script'" is a java 
command with an appropriate class file and with a -name to specify where 
the script is to run. So even though the "script" is interpreted it's 
not interpreted by java as it's not java code. IOW other options need to 
be specified, etc. However I didn't go to the Unix admin and ask him 
about how to do this - I wouldn't suspect he'd know. I had to go to the 
makers of the test software and ask them how this is supposed to work.
-- 
Andrew DeFaria <http://defaria.com>
Bureaucracy: a method of turning energy into solid waste.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019