cscript.exe vs wscript.exe 
Author Message
 cscript.exe vs wscript.exe

What's the difference? The WSH docs tell you how to change the default
script engine from one to the other, but they don't tell you _why_ you would
want to.

Jeff
--
Jeffrey T. Muller
Genetic MicroSystems, Inc.

http://www.*-*-*.com/



Fri, 21 Sep 2001 03:00:00 GMT  
 cscript.exe vs wscript.exe

Quote:

> What's the difference? The WSH docs tell you how to change the default
> script engine from one to the other, but they don't tell you _why_ you would
> want to.

> Jeff
> --
> Jeffrey T. Muller
> Genetic MicroSystems, Inc.

> http://www.geneticmicro.com

The functionality of is identical for the two versions, except in one
area.  They differ in which user interface, GUI or console, they use.
That is, Wscript is intended for use with the GUI, exclusive, while
cscript is intended for use primarily with the old 'DOS' text only
interface.  Theus the 'W' stands for Windows and the 'c' for command
line (I have noted that the documentation uses cap W and lowercase c).

The most obvious example is Wscript.Echo, which always pops up a GUI
window (even when Wscript is called from a 'DOS' command prompt.
Invoking this same method with a script in cscript will open a DOS
session (if not called from one) and display the argument as a text
string.  Another example is that cscript can be used to open the CON
(console) device for I/O (i.e. for .Reads and .Writes), while doing this
in Wscript only hangs the application as there is no actual connection
opened (no error message mind you, just a failure to work).

I haven't explored all aspects, but my limited experience suggests these
differences are confined to the user interface functions.

The differences only apply to the INTRINSIC methods/functions, not those
supplied by the underling language engine.  For example, use of the VB
InputBox function will always open a GUI dialog box, regardless of which
version of the host is used.

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Fri, 21 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Running cscript.exe and wscript.exe from the floppy drive

2. return values of WSCRIPT.EXE and CSCRIPT.EXE

3. WScript.Quit is not terminating wscript.exe

4. Cscript.exe and response.redirect

5. cscript.exe

6. Cscript.exe and script engine

7. how to run vbs from asp (via cscript.exe)

8. Running PKZip fails from within VBS through Cscript.exe

9. cscript.exe

10. EventLog script kill CScript.exe........

11. running cscript.exe in silent mode?

12. cscript.exe running in the same window

 

 
Powered by phpBB® Forum Software