Any help would be much appreciated.
Thanks
Shawn bertin
sbe...@basics.com
msg = Shell.Popup("Type message here", 2, "Title Here", 0 + 48)
2 is the Timer. Set to how long you want the popup to be displayed for. Look
it up in the WSH reference for more information.
Thanks,
Chris Allen (ScriptJunkie)
"Shawn Bertin" <sbe...@basics.com> wrote in message
news:Op2VnWuB...@TK2MSFTNGP10.phx.gbl...
________________________________________
I got bored with my old signature,
so I changed it
Atrax. MVP, IIS
http://rtfm.atrax.co.uk/
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Thanks,
Chris Allen
"Atrax _" <anon...@devdex.com> wrote in message
news:ebjOnjuB...@TK2MSFTNGP12.phx.gbl...
"Chris Allen" <Krazy...@hotmail.com> wrote in message
news:#iD6pkuB...@TK2MSFTNGP11.phx.gbl...
That seems to work, although it seems when I start to run the message
box, it will wait there until which time as the user clicks the ok
button, I wanted it to run along with the script.
Any help would be appreciated.
Thanks again.
Shawn
"Shawn Bertin" <sbe...@basics.com> wrote in message
news:OjzDxt1...@TK2MSFTNGP10.phx.gbl...
All I want to do is have a popup message that says "Please wait while
your login script executes" run while the login script is executing, and
then automatically close once it has finished.
Any help on this operation would be much appreciated.
I was thinking of something like a do while ???
> I am trying to run a script that executes a message window while the script
> runs and then closes automatically at the end.
Hi
Some examples of using IE from a vbscript (WSH) to create a progress "dialog":
Using ms Internet Explorer for Scripting Dialogs
http://home.att.net/~wshvbs/#UsingIEforDialogs
From: Christoph Basedau (cebit_...@gmx.net)
Newsgroups: microsoft.public.scripting.wsh
Date: 2003-02-20 03:01:10 PST
http://groups.google.com/groups?selm=uz6xz7M2CHA.1640%40TK2MSFTNGP10.phx.gbl
Subject: Showing progress of VB script execution.
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-07-25 23:29:21 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=1dc201c2346d%240743aaf0%243aef2ecf%40TKMSFTNGXA09&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3D1dc201c2346d%25240743aaf0%25243aef2ecf%2540TKMSFTNGXA09
Here is an example on using IE to give the user status while the script is
progressing:
Set oIE = CreateObject("InternetExplorer.Application")
Set oShell = CreateObject("WScript.Shell")
sTitle = "Message dialog" ' used by AppActivate
With oIE
' .FullScreen = True with a resize will give a very
' "clean" window (kiosk mode).
' The only way for the user to close the window is using Alt+F4
' (or terminate iexplore.exe)
' Doesn't work very good with IE6 SP1 anymore
'.FullScreen = True
' Here is a workaround:
' For a more "normal" window with a title bar with close cross,
' disable the line line ".FullScreen = True" and enable the 4 lines
' below. The script will handle that the user closes the window
.AddressBar = False
.ToolBar = False
.StatusBar = False
.Resizable = False
.Navigate("about:blank")
Do Until .readyState = 4: wscript.sleep 100: Loop
With .document
With .ParentWindow
SWidth = .Screen.AvailWidth
SHeight = .Screen.AvailHeight
SWidthW = .Screen.AvailWidth * .25
SHeightW = .Screen.AvailHeight * .1
.resizeto SWidthW, SHeightW
.moveto (SWidth - SWidthW)/2, (SHeight - SHeightW)/2
End With
' Joe Earnest's "refresh" protection
.WriteLn ("<html>")
.WriteLn ("<head>")
' If concatenating VBScript, concatenate
' vbCr's or vbCrLf's after each line.
' This script is placed in the head by
' convention; it can be placed in the body.
.WriteLn ("<script language=""vbscript"">")
' NOTE: The following code uses a hidden value to
' avoid external pushbutton subs.
' GetRef references to external subs in the script
' may also be used for pushbuttons.
' A hidden value provides better [x] or [Alt]+[F4] error
' trapping for a dialog with pushbuttons only, where no
' other controls are being polled.
' While this routine parses an exit button id in a specific manner,
' the entire exit buttion id could be placed the value,
' a string value could be polled, and the button id could be parsed
' later for specific operation.
.WriteLn ("Sub ExitButton ()")
.WriteLn ("ExitButtonID= LCase(Trim(window.event.srcelement.id))")
.WriteLn ("If Left(ExitButtonID, 4)=""xbtn"" Then")
.WriteLn ("window.exitbtn.value= Mid(ExitButtonID, 5)")
.WriteLn ("End If")
.WriteLn ("End Sub")
' NOTE: The following code traps refresh and context
' menu keys to avoid dialog corruption by refreshing.
.WriteLn ("Sub NoRefreshKey ()")
.WriteLn ("Select Case window.event.keycode")
.WriteLn ("Case 82: SuppressKey= window.event.ctrlkey")
.WriteLn ("Case 116: SuppressKey= True")
.WriteLn ("End Select")
.WriteLn ("If SuppressKey Then")
.WriteLn ("window.event.keycode= 0")
.WriteLn ("window.event.cancelbubble= True")
.WriteLn ("window.event.returnvalue= False")
.WriteLn ("End If")
.WriteLn ("End Sub")
.WriteLn ("Sub NoContextMenu ()")
.WriteLn ("window.event.cancelbubble= True")
.WriteLn ("window.event.returnvalue= False")
.WriteLn ("End Sub")
' NOTE: The following code implements the above subroutines.
.WriteLn ("Set document.onclick= GetRef(""ExitButton"")")
.WriteLn ("Set document.onkeydown= GetRef(""NoRefreshKey"")")
.WriteLn ("Set document.oncontextmenu= GetRef(""NoContextMenu"")")
.WriteLn ("</script>")
.WriteLn ("</head>")
.WriteLn ("<body>")
.WriteLn ("Script is Executing....")
.WriteLn ("</body>")
.WriteLn ("</html>")
With .ParentWindow.document.body
.style.backgroundcolor = "LightBlue"
.scroll="no"
.style.Font = "12pt 'Arial'"
'.style.borderStyle = "outset"
'.style.borderWidth = "2px"
End With
.Title = sTitle
oIE.Visible = True
WScript.Sleep 100
oShell.AppActivate sTitle
End With ' document
End With ' oIE
For i = 1 to 3
wscript.sleep 1500
MsgIE("Doing someting!" & vbCrLf & "New line # " & i)
Next
wscript.sleep 2000
MsgIE(" Script Complete!")
wscript.sleep 2000
MsgIE("IE_Quit")
Sub MsgIE(sMsg)
On Error Resume Next ' Just in case the IE window is closed
If sMsg = "IE_Quit" Then
oIE.Quit
Else
oIE.Document.Body.InnerText = sMsg
oShell.AppActivate sTitle
End If
End Sub
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter
Play around with something like this
for i = 1 to 1000000
if i = 1 then
set ie = createobject("internetexplorer.application")
ie.navigate "about:blank"
ie.height = 250
ie.width = 500
ie.visible = true
ie.document.body.innertext = "Please wait while your login script executes"
do until ie.readystate = 4
wscript.sleep 100
loop
end if
i = i+1
if i = 1000000 then ie.quit
next
wscript.sleep 1000
msgbox "i = " & i
set ie = nothing
"Michael Dunn" <m_o...@yahoo.com> wrote in message
news:#rBU233B...@TK2MSFTNGP12.phx.gbl...