Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you display the progress of a script? 1

Status
Not open for further replies.

TWR2

Programmer
Sep 13, 2002
2
US
I am creating logon scripts for my network with VBS. I want to be able to display the progress to the user so that we can see what is being done. Is there a way to display step by step what is being done like a batch file?

 
I don't think so - our script just puts up a messagebox when it has finished.
 
I have found that opening an instance of IE and writing out to that is a good way of keeping track, you will have to enter the code to write out to the browser but if it is only so that a user can see what is happening then it is quite useful.

Example below

Set objExplorer = WScript.CreateObject("InternetExplorer.Application")

Call Progress_Window

'Define Output Window for progress results
Private Sub Progress_Window
Dbreak = &quot;<br>&quot; & &quot;<br>&quot;
Sbreak = &quot;<br&quot;
objExplorer.Navigate &quot;about:blank&quot;
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width=400
objExplorer.Height = 200
objExplorer.Left = 0
objExplorer.Top = 0
Do While (objExplorer.Busy)
Wscript.Sleep 200
Loop
objExplorer.Visible = 1
objExplorer.Document.Body.InnerHTML = &quot;message goes here and Dbreak will cause a double CRlf&quot; & Dbreak
End Sub

To add extra information you will have to use
objExplorer.Document.Body.InnerHTML = objExplorer.Document.Body.InnerHTML + &quot; next message goes here and Dbreak will cause a double CRlf&quot; & Dbreak

Regards
Steve Friday
 
Thanks.

A typical form would look a bit nicer, but this will do. Is there a way to throw in a &quot;close&quot; button at the bottom when I am done.
 
objexplorer.Quit would close the window, you could use wsh.popup to ask them if they want to close the window and dependent on the result do the .Quit

Regards
Steve Friday
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top