Re: wscript.echo and MsgBox stop execution of my script. Solution?

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

From: Michael Bouchard (mbouchard_at_xNOSPAMx.ci.charlotte.nc.us)
Date: 08/11/04


Date: Wed, 11 Aug 2004 09:05:26 -0400

You can use AutoIT for this (www.hiddensoft.com). I have created an AutoIT
script which I then compiled into an exe. I can then call this exe from a
script or command line with the parameters specified. When I want to close
the message box, I just need to call the exe with no parameters.

**Start Sample VBscript Watch for line wraps
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
sTEST = "300 150 50 50 16 -1 -1"'position of window. Look at Documentation
for specifics
'Note adding a ^ will cause a LF(1 LF per^).
'SplashTextOn($title, $message, $wide, $high, $xpos, $ypos, $opt,
"",$fsize,$fweight)
WshShell.Run "SplashText.exe ""This is the Title"" ""Testing SplashText"" "
& sTEST
wscript.sleep 3000
WshShell.Run "SplashText.exe ""This is the Title"" ""The Text will wrap if
it is too long for the window."" " & sTEST
wscript.sleep 3000
WshShell.Run "SplashText.exe ""This is the Title"" ""Adding 1 of these (The
Char above the number 6) will enter a LF^See^What^I^Mean."" " & sTEST
wscript.sleep 3000
WshShell.Run "splashtext.exe" 'Run it again to close it

**Start AutoIT script
;splash.au3 precomplie
AutoItSetOption("TrayIconHide", 1);1 = Hide Icon
winclose("Splashtext1");close other progress bar and show this one
AutoItWinSetTitle ("Splashtext1")

If $CmdLine[0]>0 Then
$title= $CmdLine[1]
$message= $CmdLine[2]
$wide = $CmdLine[3]
$high = $CmdLine[4]
$xpos = $CmdLine[5]
$ypos = $CmdLine[6]
$opt = $CmdLine[7]
$fsize = $CmdLine[8]
$fweight = $CmdLine[9]

$message2 = StringReplace($message, "^", @LF)

SplashTextOn($title, $message2, $wide, $high, $xpos, $ypos, $opt, "",
$fsize, $fweight)
While 1
Sleep(5000)
wend
EndIf

"Brendan O" <wildirishtiming@hotmail.com> wrote in message
news:4cbdb58c.0408100922.5ce25440@posting.google.com...
> I don't want a front end, I don't want any windows open, I don't want
> a gui. I need a function that I can call like msgbox that will open a
> popup window
> for notifications only, yet continue to run my code even if a user
> isn't
> sitting at the desk to press the OK button.
>
> Unless I'm mistaken completely, MsgBox and wscript.echo both halt
> script operations waiting for the user to press ok.
>
> Thanks for your help!
>
> -Brendan


Quantcast