Re: VBScript calls itself



"shadowHead" <Alpamayo2030@xxxxxxxxx> wrote in message
news:1120095281.980644.48880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I have a small vbs script that creates an InternetExplorer object and
> runs some stuff but from time to time IE kills over. I have an event
> handler for IE_onQuit but I am wondering I may need to put in there to
> acomplish the following.
>
> When IE dies, my script dies because the object is gone, I would like
> my script to instantiate itself and basically start over by itself.
>
> I had some test code on self instantiation but it is kinda out of
> control, it runs wild replicating 100's of cmd windows. Here is the
> code:
> Dim WshShell, oExec
> Set WshShell = CreateObject("WScript.Shell")
>
> w = WScript.ScriptFullName
> w = Chr(34) & w & Chr(34)
> w = "cmd /k " & w
> WshShell.Run(w)
> WScript.Sleep 10000
>
> How would I get my script to start over ?

This is not exactly the answer you are probably looking for, but one of
the things I do in my scripts that use IE for output is to test the variable
type before writing to my IE window, especially in loops. You can use
something like:

If TypeName(IE) = "IWebBrowser2" Then {some code}

If the IE window you instantiated is still present, it will have a
TypeName of 'IWebBrowser2', once it is closed, the TypeName become "Object".
I generally put a line like this in my loop that write to IE:

If TypeName(IE) = "Object" Then WScript.Quit

...but my needs are different than yours. I do this to let the user end
the script by closing the IE windows.


.



Relevant Pages

  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.misc)
  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.firewalls)
  • [NT] Flaw in Windows Script Engine Could Allow Code Execution
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... The Windows Script Engine provides Windows operating systems with the ... blocked by Outlook Express 6.0 and Outlook 2002 in their default ...
    (Securiteam)
  • Re: Right click on text vs. right click on hyperlink
    ... I were to do that the built-in Windows way, I have to go down about ... >> me to open in one step the editing page of any archive page in my ... >> contains the below Windows script. ... >> that url and opens the editing page. ...
    (microsoft.public.scripting.vbscript)
  • Re: Turing of SP2 Firewall via registry entry?
    ... Group Policy that disables the firewall (see WF_XPSP2.doc ... Disabling the Use of Windows Firewall Across Your Network ... you create a script file that is read by ...
    (microsoft.public.windowsxp.security_admin)

Loading