Showing progress of VB script execution. 
Author Message
 Showing progress of VB script execution.

Hi All..
I have a VBScript file(.wsf), which takes a long execution
time..Is it possible to show a progress bar?

Thank you very much.
Sen.



Tue, 11 Jan 2005 14:23:59 GMT  
 Showing progress of VB script execution.

Quote:

> Hi All..
> I have a VBScript file(.wsf), which takes a long execution
> time..Is it possible to show a progress bar?

> Thank you very much.
> Sen.

A lot of progress bar stuff here:

http://home.att.net/~wshvbs/index.htm

e.g.
http://home.att.net/~wshvbs/index.htm#UsingIEforDialogs
http://home.att.net/~wshvbs/index.htm#wshLtWtNonModalDlg

You can use IE to create a popup and change the text as well inside it while
your script is going
along. Run the script below for a demo.

The script below gives the user the chance to close the popup by clicking on the
x in the windows top
bar. The script will handle that.

If you want a dialog without this windows top bar, enable the line .FullScreen =
True (the window will
be resized ;-). The only way the user can close it now, is with Alt-F4.

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)

  .FullScreen = True

  ' For a more "normal" window with a title bar with close cross,
  ' disable the line line ".FullScreen = True" and enable the 3 lines
  ' below. The script will handle that the user closes the window

  '.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 * .15
      SHeightW = .Screen.AvailHeight * .05

      .resizeto SWidthW, SHeightW
      .moveto (SWidth - SWidthW)/2, (SHeight - SHeightW)/2

    End With

    .Write "<body> Script is Executing....</body></html>"

    With .ParentWindow.document.body
      .style.backgroundcolor = "LightBlue"
      .scroll="no"
      .style.Font = "12pt 'Arial'"
      .style.borderStyle = "outset"
      .style.borderWidth = "4px"
    End With

    .Title = sTitle
    oIE.Visible = True
    WScript.Sleep 100
    oShell.AppActivate sTitle
  End With ' document
End With   ' oIE

wscript.sleep 2000
MsgIE(" Doing someting!")

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



Tue, 11 Jan 2005 15:15:50 GMT  
 Showing progress of VB script execution.
Torgeir:

   Your sample script is great.  The best example of how
to use IE for displaying a progress bar.  By question is -
Where can I find documentation on all properties, methods,
etc. of the "InternetExplorer.Application" object?  My
biggest frustration with VB script is finding out about
the various objects which can be invoked.  Is there a good
web site where such objects, their properties, etc. and
sample code can be found?

Quote:
>-----Original Message-----

>> Hi All..
>> I have a VBScript file(.wsf), which takes a long
execution
>> time..Is it possible to show a progress bar?

>> Thank you very much.
>> Sen.

>A lot of progress bar stuff here:

>http://home.att.net/~wshvbs/index.htm

>e.g.
>http://home.att.net/~wshvbs/index.htm#UsingIEforDialogs
>http://home.att.net/~wshvbs/index.htm#wshLtWtNonModalDlg

>You can use IE to create a popup and change the text as

well inside it while
Quote:
>your script is going
>along. Run the script below for a demo.

>The script below gives the user the chance to close the

popup by clicking on the
Quote:
>x in the windows top
>bar. The script will handle that.

>If you want a dialog without this windows top bar, enable

the line .FullScreen =

- Show quoted text -

Quote:
>True (the window will
>be resized ;-). The only way the user can close it now,
is with Alt-F4.

>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)

>  .FullScreen = True

>  ' For a more "normal" window with a title bar with
close cross,
>  ' disable the line line ".FullScreen = True" and enable
the 3 lines
>  ' below. The script will handle that the user closes
the window

>  '.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 * .15
>      SHeightW = .Screen.AvailHeight * .05

>      .resizeto SWidthW, SHeightW
>      .moveto (SWidth - SWidthW)/2, (SHeight - SHeightW)/2

>    End With

>    .Write "<body> Script is Executing....</body></html>"

>    With .ParentWindow.document.body
>      .style.backgroundcolor = "LightBlue"
>      .scroll="no"
>      .style.Font = "12pt 'Arial'"
>      .style.borderStyle = "outset"
>      .style.borderWidth = "4px"
>    End With

>    .Title = sTitle
>    oIE.Visible = True
>    WScript.Sleep 100
>    oShell.AppActivate sTitle
>  End With ' document
>End With   ' oIE

>wscript.sleep 2000
>MsgIE(" Doing someting!")

>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

>.



Tue, 11 Jan 2005 21:19:36 GMT  
 Showing progress of VB script execution.
You query also interested me. I was able to find this if it helps.

http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_refer...
http://msdn.microsoft.com/downloads/samples/internet/wizard/default.asp

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows 2000 Client/ User Interface]

Quote:

> Torgeir:

>    Your sample script is great.  The best example of how
> to use IE for displaying a progress bar.  By question is -
> Where can I find documentation on all properties, methods,
> etc. of the "InternetExplorer.Application" object?  My
> biggest frustration with VB script is finding out about
> the various objects which can be invoked.  Is there a good
> web site where such objects, their properties, etc. and
> sample code can be found?



Wed, 12 Jan 2005 03:14:43 GMT  
 Showing progress of VB script execution.

Quote:

> You query also interested me. I was able to find this if it helps.

> http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_refer...
> http://msdn.microsoft.com/downloads/samples/internet/wizard/default.asp

Hi

Yes, you got a couple of good ones there.

Some more:

InternetExplorer Object
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objec...

And as Alex Angelopoulos says it:
"One other thing you might want is a locally downloaded copy of inet.chm, which is the
big, got-it-all reference from Microsoft.  You have to download it from the SDK page;
it's roughly 35 MB, but worth it.... This is a fast, fairly complete ref to
objects,elements, properties and methods for IE and the DOM -kind of."

Platform SDK Update Site
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

choose "Internet Development SDK" in the left pane. It's a 20 MB download.

--
torgeir



Wed, 12 Jan 2005 06:27:33 GMT  
 Showing progress of VB script execution.

Quote:

> Torgeir:

>    Your sample script is great.  The best example of how
> to use IE for displaying a progress bar.  By question is -
> Where can I find documentation on all properties, methods,
> etc. of the "InternetExplorer.Application" object?  My
> biggest frustration with VB script is finding out about
> the various objects which can be invoked.  Is there a good
> web site where such objects, their properties, etc. and
> sample code can be found?

You got some MS documentation links in a couple of other posts, here are some
more examples on how to use IE from WSH:

Before I forget it, you could consider using HTA as the application interface as
well, see here for more info:



Subject: Re: graphical looks with VBscript
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-03-08 04:03:57 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=ecC7...

*******************************************
Michael Harris' "msg.wsc" IE-Dialog Utility at Clarence Washington's site...
http://cwashington.netreach.net/depo/view.asp?Index=409&ScriptType=co...

Click on the download icon in upper left corner - the zip file download has the
msg.wsc and some demo scripts.

*******************************************
Here is a script that gives you a "message box" with a window that scrolls when
the text reaches the bottom:



Subject: Re: Autoscroll in iE ?
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-07-19 09:34:31 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3D38...

*******************************************
Here is an example that asks for a password, masking the input. When the user
clicks the OK button, the vbscript retrieves the password from IE:



Subject: Re: window.open using a WSH or VB script
Newsgroups: microsoft.public.scripting.wsh
Date: 2002-07-10 09:36:46 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3D2C...

*******************************************
Here is a kind of printer installer GUI where the user can tick of the
printer(s) he want installed:



Subject: Re: printers
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-03-10 10:50:15 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3C8B...

*******************************************
Here is the script by Tom Lavedas that is the "mother" of the scripts above,
this is the one that got me starting to learn to use IE as GUI for WSH.

Tom's script has check boxes, radio buttons and a password input field.



Subject: Re: check box
Newsgroups: microsoft.public.scripting.wsh
Date: 2001-03-19 07:28:08 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3AB6...

--
torgeir



Wed, 12 Jan 2005 07:42:10 GMT  
 Showing progress of VB script execution.
Thanks Torgeir,

I'll bookmark that link. Also inet.chm was one I was really looking for, I found I already had it
installed from the MSDN subscription.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows 2000 Client/ User Interface]

Quote:

> Hi

> Yes, you got a couple of good ones there.

> Some more:

> InternetExplorer Object
> http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objec...

> And as Alex Angelopoulos says it:
> "One other thing you might want is a locally downloaded copy of inet.chm, which is the
> big, got-it-all reference from Microsoft.  You have to download it from the SDK page;
> it's roughly 35 MB, but worth it.... This is a fast, fairly complete ref to
> objects,elements, properties and methods for IE and the DOM -kind of."

> Platform SDK Update Site
> http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

> choose "Internet Development SDK" in the left pane. It's a 20 MB download.

> --
> torgeir



Wed, 12 Jan 2005 10:39:33 GMT  
 Showing progress of VB script execution.
Thanks to Dave and Torgeir for their very helpful
suggestions.  
Quote:
>-----Original Message-----
>Thanks Torgeir,

>I'll bookmark that link. Also inet.chm was one I was

really looking for, I found I already had it
Quote:
>installed from the MSDN subscription.

>--
>Regards,

>Dave Patrick ....Please no email replies - reply in
newsgroup.
>Microsoft MVP [Windows 2000 Client/ User Interface]


>> Hi

>> Yes, you got a couple of good ones there.

>> Some more:

>> InternetExplorer Object

http://msdn.microsoft.com/workshop/browser/webbrowser/refer
ence/objects/internetexplorer.asp
Quote:

>> And as Alex Angelopoulos says it:
>> "One other thing you might want is a locally downloaded

copy of inet.chm, which is the
Quote:
>> big, got-it-all reference from Microsoft.  You have to

download it from the SDK page;
Quote:
>> it's roughly 35 MB, but worth it.... This is a fast,

fairly complete ref to
Quote:
>> objects,elements, properties and methods for IE and the
DOM -kind of."

>> Platform SDK Update Site

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
Quote:

>> choose "Internet Development SDK" in the left pane.

It's a 20 MB download.

- Show quoted text -

Quote:

>> --
>> torgeir

>.



Fri, 14 Jan 2005 23:28:20 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. How do I display a progress bar showing progress for database replication

2. How do I display a progress bar showing progress for database replication

3. Showing Compacting Progress in VB

4. VB Script - Progress Bar

5. VB Script execution

6. Execution of Code in Vb Script

7. Progress or something to let user know script is in progress (WSH, not HTML)

8. VB Script to always show $.00 Cents

9. Show progress bar

10. taskmanager dont show WScript execution

11. Problem: Shell Object to show copy progress

12. How to show status window/progress bar

 

 
Powered by phpBB® Forum Software