VBScript script progress notification

前端 未结 4 1616
花落未央
花落未央 2021-01-04 12:25

I\'m a VBScript novice, writing a script that will be parsing large input file(s) and will likely take several minutes run time to complete processing. I need a way to aler

4条回答
  •  一向
    一向 (楼主)
    2021-01-04 12:42

    In such cases I'd like to use WshShell.Popup method to provide information about the current progress.

    Here an example:

    Dim WshShell, i
    Set WshShell = CreateObject("WScript.Shell")
    
    For i = 1 To 500
        'Do Something
        If i Mod 100 = 0 Then 'inform for every 100 process 
            WshShell.Popup i & " items processed", 1, "Progress" ' show message box for a second and close
        End If
    Next
    

提交回复
热议问题