Programming: Missing WScript namespace?

Came across this on usenet. Copied here so I’ll not lose it!

“WScript is an object exposed by the WScript and CScript script hosts. Since the
Microsoft Script Control is a different host, it does not have that internal
method available to it.

You can work around that by adding the WScript namespace to a script control
instance, assuming that the original host creating the instance is itself a
WSH-hosted script.

If your script control is referenced as sc, then once you initialize it you can
add WScript using the native name using the Script Control’s AddObject method,
like this:


Sc.AddObject “WScript”, WScript

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: