Re: hta file refresh output in textarea
- From: "B-Mann" <RemoveSpaces(b __ m a n n @ h o t m a i l.c o m)>
- Date: Thu, 5 Jan 2006 05:30:32 -0500
"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
.
- References:
- hta file refresh output in textarea
- From: Rich Milburn [MVP]
- hta file refresh output in textarea
- Prev by Date: Re: hta file refresh output in textarea
- Next by Date: Re: mass rename part duex
- Previous by thread: Re: hta file refresh output in textarea
- Next by thread: Re: Running a Vbscript with Scheduled Tasks
- Index(es):
Relevant Pages
|