Hi, this depends on what you're doing......and you want to show the progress of....if you are talking about showing progress while copying files, try this:
'==========
strTargetFolder = "\\server\share"
If Right(strTargetFolder, 1) <> "\" Then strTargetFolder = strTargetFolder & "\"
Const FOF_CREATEPROGRESSDLG = &H10&
Set objFSO = CreateObject("Scripting.Fi
Set objShell = CreateObject("Shell.Applic
Set objFolder = objShell.NameSpace(strTarg
strFileToMove = "C:\Temp\Test.txt"
Set objFile = objFSO.GetFile(strFileToMo
If Not objFolder Is Nothing Then
objFolder.MoveHere objFile.Path, FOF_CREATEPROGRESSDLG
Else
MsgBox "There was an error finding " & strTargetFolder
End If
'==========
Regards,
Rob.
Main Topics
Browse All Topics





by: MeCanHelpPosted on 2008-01-11 at 04:52:26ID: 20635797
You can track progress in a command window to a certain extent, however if your normal progress bar that comes with regular apps. is what you are seeking then you are going to be sort of dissapointed with using VBS. Here is sort of an example of how you would do it.
sonate}!\\ " & strComputer & "\root\cimv2")
elect * from Win32_Service")
rnetExplor er.Applica tion")
InnerHTML = "Retrieving service information. " _
InnerHTML = "Service information retrieved."
Wscript.Echo "Processing information. This might take several minutes."
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
Set colServices = objWMIService.ExecQuery("S
For Each objService in colServices
Wscript.StdOut.Write(".")
Next
Wscript.StdOut.WriteLine
Wscript.Echo "Service information processed."
Now you can also get a simular one by using IE as well:
Set objExplorer = WScript.CreateObject("Inte
objExplorer.Navigate "about:blank"
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.
& "This might take several minutes to complete."
strComputer = "."
Set colServices = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"). _
ExecQuery("Select * from Win32_Service")
For Each objService in colServices
Wscript.Sleep 200
Next
objExplorer.Document.Body.
Wscript.Sleep 3000
objExplorer.Quit