Re: Events from unregistered WSC?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"mr_unreliable" <kindlyReplyToNewsgroup@xxxxxxxxxxx> wrote in message
news:uCvLSchSGHA.4740@xxxxxxxxxxxxxxxxxxxxxxx
hi James,

I have no trouble with that:

Set oWSC = GetObject("script:" & sComponentPath)

WScript.ConnectObject oWSC, sEventPrefix

Note, you may be getting thrown off the track by a documentation
error:

--- <doc> ---
Connects the object's event sources to functions with a given prefix.

object.ConnectObject(strObject, strPrefix)

Arguments
object WScript object.

strObject Required. String value indicating the name of the object
you want to connect.

strPrefix Required. String value indicating the function prefix.
--- </doc> ---

While it _says_ that strObject should be a string, that's wrong.

You should use the object itself for that parameter.

Thanks, jw, that worked well!



.



Relevant Pages

  • Re: Events from unregistered WSC?
    ... String value indicating the name of the object you want to connect. ... String value indicating the function prefix. ... I know that I can use a WSC without registering it by using ...
    (microsoft.public.scripting.wsh)
  • Re: Netzlauferk Verbindung über VBS
    ... Gruss & Dank Koni ... String value indicating the user password. ...
    (microsoft.public.de.german.scripting.wsh)
  • Re: Map a drive with wmi?
    ... Set WshNetwork = WScript.CreateObject ... String value indicating the name by which the mapped drive will be known ... the mapping is stored in the user profile. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Map a drive with wmi?
    ... > Set WshNetwork = WScript.CreateObject ... > String value indicating the name by which the mapped drive will be known ... the mapping is stored in the user profile. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: request help, how do I map drive to other box as different user
    ... strLocalName - String value indicating the name by which the mapped drive ... Boolean value indicating whether the mapping ... > I use the following script to map drives and copy files ...
    (microsoft.public.scripting.vbscript)