Can using Wscript.StdOut.Write ?
moonhk schrieb:
Sure it can. Try it. It doesn't depend on the hosting app.
Seems to me you're mislead by the term 'WScript'.
1.st, 'WScript' as keyword in Windows-script - be it hosted by
Wscript.exe or Cscript.exe - is an
intrinsic automated singleton object whose existence you can
rely on throughout any scripts runtime - as long they're hosted
by one of these two 'offical' Microsoft Windows host apps
- you don't have the WScript-object in HTA, HTML, ASP or
3rd-party hosted scripts - also independendly of the scripting
language.
WScript-object always exposes an Argument-property, that
as of WSH 5.6 is devided into a named and an unnamed
collection of commandline-args.
An alias for the WScript-object is btw 'WSH'
That's why the shorthand 'WSH.Echo WSH.FullName, WSH.Version'
returns the host path and the major version of WSH in VBS.
2.nd, 'WScript' on the cmd-line denotes an executable
name (lacking the extension) that you can run ("host")
a script with - instead of hosting it with cscript.exe.
3.rd, 'WScript' as part of the progids of some scriptable
COM-interfaces ('WScript.Shell', WScript.Network')
refers to different kind of objects that you have to
explictly create inside your scripts, like
set shell = createobject("Wscript.Shell")
"Wscript.Shell" refers btw to another COM-interface, technical
names are 'IWshShell' to 'IWshShell3' - then the interface exposed
by WScript-object, whose technical name is 'IHost' and which has
no progid since it's non-createable.
So now you probably done with WScript ;-)
MfG,
Alex
|