Hi Everybody,
I've been doing a bit of vbscript coding for use in CA's and I've noticed quite a few discrepencies between when I run my VBscript from the desktop and when I run it from within a CA... most of these have been eliminated by the removal of references to the Wscript object when making calls to its methods in the CA, however not all. I do not understand why this should be... Anyone care to enlighten me?
The current problem I'm facing is when using the Sleep method; if I specify:
Wscript.Sleep 100
which works fin on the desktop, then in the CA I get a vbscript object required error.
And if I specify in the CA simply:
Sleep 100
I get a parameter mismatch error
Please help
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Wscript host object & VBScript CA's
Started by
danna boneheart
, Jun 05 2002 16:15
6 replies to this topic
Posted 06 June 2002 - 00:48
When you run your script from the desktop, the WScript object is automatically created an available to you. When you run your script through a CA, the WScript object isn't automatically created.
If you want to create a particular WScript object, you need to make a call to CreateObject. (Note: Do not call WScript.CreateObject, because WScript still isn't available)
If you want to create a particular WScript object, you need to make a call to CreateObject. (Note: Do not call WScript.CreateObject, because WScript still isn't available)
Posted 06 June 2002 - 15:44
Thanks for the info,
but in that case how do I access methods such as Echo and Sleep since I can't instanciate an instance of the WScript object myself and I can't access it from a CA?
Or is there a short answer
but in that case how do I access methods such as Echo and Sleep since I can't instanciate an instance of the WScript object myself and I can't access it from a CA?
Or is there a short answer
Posted 06 June 2002 - 18:54
I'm looking for the answer to this very question Danna. Please help us!!
Posted 10 June 2002 - 08:21
I don't see a dilemma. Simply create a shell object by using
Dim oWSHShell
Set oWSHShell = CreateObject("WScript.Shell")
and you have a shell object in your script and can use it with
oWSHShell.Sleep 100
for example.
Dim oWSHShell
Set oWSHShell = CreateObject("WScript.Shell")
and you have a shell object in your script and can use it with
oWSHShell.Sleep 100
for example.
h.teichert-ott
Posted 10 June 2002 - 17:49
I don't mean to hijack your thread Danna...
hteichert,
Unfortunately the Sleep() method is not supported by the shell object. As such, your code snippet is invalid. This is precisely our issue. Any other ideas?
Thanks,
Jeff
hteichert,
Unfortunately the Sleep() method is not supported by the shell object. As such, your code snippet is invalid. This is precisely our issue. Any other ideas?
Thanks,
Jeff
Posted 17 June 2002 - 10:06
.... and you can't instanciate the windows script host object either so I think the short answer is the only option