0

I have a .vbs script that works great, except that I want a display window of the steps without the script stopping or closing the window.

Since I don't know how to do this, I wrote something like this prior to each step:

DisplayMessage = CrLf & _
   "Step 1: Blah, blah, blah"  & DoubleCrLf & _
    oShell.CurrentDirectory & CrLf
oShell.Popup DisplayMessage, 2, "Script Process"

As you know, this pops up a window with the message and pauses for 2 seconds, then closes the window.

What I do is continually add to DisplayMessage what I want displayed and do the popup again.

This works, except for two issues. First, there's a lot of pausing going on because if I don't pause I miss the message. Second, if the step takes several seconds to process I don't have a window to look at telling me what step is being executed. It pops it up, pauses and then closes the window.

What I'd like is some kind of native looking window that is always displayed, that changes the mouse to the "processing"/"waiting" circle and maybe even a process completed percentage bar (although this and the mouse-circle are not necessary).

Can I do this in vbs or will I need to write it in something else?

TIA

Alex K.
  • 171,639
  • 30
  • 264
  • 288
LEBoyd
  • 151
  • 12
  • 1
    If you want a GUI for VBScript take a look at [HTA Applications](https://en.wikipedia.org/wiki/HTML_Application) – Alex K. Jan 06 '17 at 14:51
  • One easy way to do it is to open up a IE page and you can keep on showing the messages in that while your script is running – Pankaj Jaju Jan 06 '17 at 14:54
  • 1
    Take a look at [this](http://stackoverflow.com/q/22513413/2165759) and [this](http://stackoverflow.com/q/22477468/2165759) questions. Also [there is one more](http://stackoverflow.com/a/28377215/2165759) excellent implementation of custom messagebox via dynamically created HTA. – omegastripes Jan 06 '17 at 21:12
  • Thank you, all. Since I'm "new" at windows/script programming, I'll have to study the HTA idea, but it seems I could learn this. – LEBoyd Jan 09 '17 at 17:19
  • It seems that HTA will open a "popup" box with the message in it. Can I write more into the same box, or would I need to close the box, add to my message (like I'm doing now) and then HTA popup the new box? It's no problem to continue as I am now, just a waste if I can write additional text into the existing message box. – LEBoyd Jan 09 '17 at 17:23
  • I ended up using the code/information from here: http://www.thoughtasylum.com/blog/2009/7/19/a-flexible-progress-window-in-vbscript.html It provided enough information for a beginner such as me. – LEBoyd Feb 16 '17 at 17:32
  • Check [this WSH VBS GUI](https://stackoverflow.com/a/47111556/2165759) solution. – omegastripes Nov 09 '17 at 15:17

0 Answers0