Python vs. VBScript vs. JavaScript in context of Windows ScriptingHost?

J

John Benson

Hi, I'm in a tightly-secured environment where I may not be allowed to use
Python for some scripting work, and may have to fall back on what came with
Windows 2K.

I'm cracking "VBScript in a Nutshell" from O'Reilly, and have found a number
of disappointments:

* can't find "Introspection" in the Index
* no record types, just numerically-indexed arrays, so record handling is
kludgy
* zero-based array indexing (this is Basic?)
* script debugger is slanted towards debugging VBScript inside Internet
Explorer
* "on error resume next" pretty much sums up the error handling
* truly bizarre use of parentheses to override argument passing by reference
in a completely nonobvious context

It looks pretty weak compared to Python, but I may not have the luxury of
Python in this situation.

Here's the question: If JavaScript is available to me within the Windows
Scripting Host, can it do everything that VBScript can? My JavaScript
documentation (the O'Reilly rhino book) is "client-side scripting"-centric,
and as such accepts the limitations on file manipulation imposed by the
client-side security scruples. Can anyone recommend a reference on
JavaScript as an expedient replacement for Python within the context of the
Windows Scripting Host?

I know this isn't the real concern of this forum, but I know there are a lot
of experienced generalists out there whose experience I would like to tap.
Thanks in advance for any responses.
 
M

Michael Geary

John said:
Here's the question: If JavaScript is available to me within the
Windows Scripting Host, can it do everything that VBScript can?

Yes, Andy's reply is right on target. JavaScript can access all of the same
WSH object model as VBScript. I think you'll find JavaScript to be a much
more satisfactory language than VBScript.
My JavaScript documentation (the O'Reilly rhino book) is
"client-side scripting"-centric, and as such accepts the
limitations on file manipulation imposed by the client-side
security scruples. Can anyone recommend a reference on
JavaScript as an expedient replacement for Python within
the context of the Windows Scripting Host?

Flanagan's book (the rhino book) will still be useful. All of Parts I and
III (Core JavaScript and Core JavaScript Reference) apply to JavaScript in
any environment: browser, WSH, Adobe Acrobat or Photoshop, you name it.

Microsoft has a very good Windows Script site with information on Script,
the WASH object model, etc. here:

http://www.msdn.microsoft.com/scripting

That plus Flanagan's book should be just about everything you need.

-Mike
 
D

Dennis Lee Bieber

* zero-based array indexing (this is Basic?)

BASIC has ALWAYS had zero-based indexing... BUT it played a game
with the users...

dim a(10)

allocates ELEVEN elements, indexed 0..10, and most people never realized
the 0 index was available.


--
 
C

Cameron Laird

Hi, I'm in a tightly-secured environment where I may not be allowed to use
Python for some scripting work, and may have to fall back on what came with
Windows 2K.
.
.
.
I'm laughing with you, not at you; I, too, have clients
who mandate various flavors of Windows, and I sure know
what you mean. Writing "tightly-secured" about such
situations tickles me no end, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,537
Latest member
BellCorone

Latest Threads

Top