Re: Running VBScript code asynchronously?
- From: "Bart Perrier" <bart_perrier@xxxxxxxxxxx>
- Date: Fri, 17 Jun 2005 15:46:03 -0500
Could the SWBem SINK Object accomplish an async-ish script?
"Leslie Houk" <lhouk@xxxxxxx> wrote in message
news:1118868895.101551.320900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Thanks for the ideas, Csaba. I borrowed from your AsyncPopup
> subroutine and came up with the following (using the same example as in
> my initial post):
>
> strMsgBoxFile = "\TempMsgBox.vbs"
> Set objMsgBoxFile = objFileSys.CreateTextFile( strMsgBoxFile, Overwrite
> )
> objMsgBoxFile.WriteLine( "MsgBox " & Chr(34) & "First line" & Chr(34) )
> objMsgBoxFile.Close
> Set objMsgBoxFile = Nothing
> objWShell.Run "cscript.exe " & strMsgBoxFile, 0
> Set objMsgBoxFile = objFileSys.GetFile( strMsgBoxFile )
> On Error Resume Next
> objMsgBoxFile.Delete Force
> On Error Goto 0
> Set objMsgBoxFile = Nothing
> MsgBox "Second line"
>
> I write out a temporary .vbs file with the first MsgBox command,
> execute the file with WShell.Run, and then delete it. Frankly, it's
> not the most elegant code I've written, but it does what I want.
>
.
- Follow-Ups:
- Re: Running VBScript code asynchronously?
- From: Leslie Houk
- Re: Running VBScript code asynchronously?
- References:
- Running VBScript code asynchronously?
- From: Leslie Houk
- Re: Running VBScript code asynchronously?
- From: Csaba Gabor
- Re: Running VBScript code asynchronously?
- From: Leslie Houk
- Running VBScript code asynchronously?
- Prev by Date: Re: validate 4 digit number
- Next by Date: Re: active x control
- Previous by thread: Re: Running VBScript code asynchronously?
- Next by thread: Re: Running VBScript code asynchronously?
- Index(es):