Re: hta file refresh output in textarea




"Rich Milburn [MVP]" <richdotmilburnatapplebeesdotcom> wrote in message
news:O$GjJ$VEGHA.1736@xxxxxxxxxxxxxxxxxxxxxxx
>I have an hta that is doing a data migration. It copies lots of files and
>displays status messages in a scrolling textarea. The scripting is
>vbscript. The flow is something like this:
>
> read filename
> textarea.value = textarea.value & "Processing " & filename
> copy filename to destination
> textarea.value = textarea.value & "Copying " & filename
> msgbox "done with these files"
> read another filename
>
> and so on. The thing is, when it stops on a message box, or to pop up a
> folder copy dialog (used for folders but FSO.CopyFile is used for
> individual files) the updates appear in the text area. But if it runs
> through a list of files to copy, even though there may be lots of updates,
> they don't show up until the next dialog box. I can't find a way to force
> the textarea to refresh the display... I've tried timers, and other things
> like that, but no luck. Any ideas?
>
> thanks
> Rich
>
> --
> Rich Milburn
> [MVP - Directory Services]
>

I had the same issue and came up with this work-around:

I call this subroutine whenever I require the screen to update:

Sub UpdateScreen()
' this is used to allow screen updates
dim CMD, WSHShell

Set WSHShell = CreateObject("WScript.Shell")
CMD = WSHShell.ExpandEnvironmentStrings("%comspec%")
WSHShell.run CMD + " /c ", 0, true
Set WSHShell = Nothing
End Sub

So you will need to modify your code to something like this:

read filename
textarea.value = textarea.value & "Processing " & filename
UpdateScreen
copy filename to destination
textarea.value = textarea.value & "Copying " & filename
UpdateScreen
msgbox "done with these files"
read another filename


Any comments welcome.

HTH
B-Mann


.



Relevant Pages

  • hta file refresh output in textarea
    ... displays status messages in a scrolling textarea. ... copy filename to destination ... files) the updates appear in the text area. ... Rich Milburn ...
    (microsoft.public.scripting.vbscript)
  • [PATCH 2.6.9-bk7] Select cpio_list or source directory for initramfs image updates [u]
    ... Here is some updates after talking to Sam Ravnborg. ... +# or set CONFIG_INITRAMFS_SOURCE to another filename or directory. ... +# 'missing' if $/$/$.shipped is missing ...
    (Linux-Kernel)
  • Re: Any suggestions?
    ... filename and I was just trying to ensure it would be filtered out. ... > value to $num below. ... This never updates, and I don't need to try to match against it anymore ... cleaner/more efficent way of doing the while loop.) ...
    (comp.lang.perl.misc)
  • Re: Drive and full path in name at top of screen
    ... You're solution works well and updates as you do which is ... Mervyn ... > the actual filename for "filename") ... > The above will display and print the drive; full path; and the Tab. ...
    (microsoft.public.excel.misc)
  • cannot run MSCONFIG - (want to remove startup processes)
    ... I am using Windows 2000 (sp4), have latest updates. ... "Cannot find the file 'MSCONFIG'. ... Make sure the path and filename are correct and that all required libraries are available." ...
    (microsoft.public.win2000.setup)