Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Progress Status

Reply
 
Old 08-12-2008   #1 (permalink)
MacMan0295


 
 

Progress Status

All,

Was wondering if there was a way to show the status of a script by doing
something like the following:

C:\Script in Progress...10%

then when the script continues it will look like this

C:\Script in Progress...20%

I would like to do this so it doesnt take up the whole screen with a bunch
of "..........". If I have 300000 loops, that is a lot of periods. I know
how to figure out the percentage. Just need to know how to replace the
text...

Thanks

Craig

My System SpecsSystem Spec
Old 08-12-2008   #2 (permalink)
mayayana


 
 

Re: Progress Status

Quote:

>
> Was wondering if there was a way to show the status of a script by doing
> something like the following:
>
> C:\Script in Progress...10%
>
> then when the script continues it will look like this
>
> C:\Script in Progress...20%
>
> I would like to do this so it doesnt take up the whole screen with a bunch
> of "..........". If I have 300000 loops, that is a lot of periods. I
know
Quote:

> how to figure out the percentage. Just need to know how to replace the
> text...
Replace the text where? You didn't say.
If you're using an HTA you can use script
to replace the text. You could also leave
the basic text the way it is, use a LABEL
for the number, and change the LABEL
innertext property. If you use STYLE to
set the font, etc. of both a span and a label
you should be able to make it look blended:

<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="VBScript">
Sub Count(NumberValue)
LabCounter.innerText = NumberValue
End Sub
</SCRIPT>
</HEAD>
<BODY onload="Count(30)">
<SPAN ID="counter"> Curent progress... <LABEL
ID="LabCounter"></LABEL></SPAN>
</BODY></HTML>




My System SpecsSystem Spec
Old 08-12-2008   #3 (permalink)
MacMan0295


 
 

Re: Progress Status

Sorry, I should have specified that I want this to update in the command
window. So it will look something like this:

C:\cscript script.vbs
C:\Script in Progress...10%
....
C:\Script in Progress...20%

Just want the percentage to change...

Thanks

Craig
"mayayana" wrote:
Quote:

>
Quote:

> >
> > Was wondering if there was a way to show the status of a script by doing
> > something like the following:
> >
> > C:\Script in Progress...10%
> >
> > then when the script continues it will look like this
> >
> > C:\Script in Progress...20%
> >
> > I would like to do this so it doesnt take up the whole screen with a bunch
> > of "..........". If I have 300000 loops, that is a lot of periods. I
> know
Quote:

> > how to figure out the percentage. Just need to know how to replace the
> > text...
>
> Replace the text where? You didn't say.
> If you're using an HTA you can use script
> to replace the text. You could also leave
> the basic text the way it is, use a LABEL
> for the number, and change the LABEL
> innertext property. If you use STYLE to
> set the font, etc. of both a span and a label
> you should be able to make it look blended:
>
> <HTML>
> <HEAD>
> <TITLE></TITLE>
> <SCRIPT LANGUAGE="VBScript">
> Sub Count(NumberValue)
> LabCounter.innerText = NumberValue
> End Sub
> </SCRIPT>
> </HEAD>
> <BODY onload="Count(30)">
> <SPAN ID="counter"> Curent progress... <LABEL
> ID="LabCounter"></LABEL></SPAN>
> </BODY></HTML>
>
>
>
>
>
My System SpecsSystem Spec
Old 08-12-2008   #4 (permalink)
James Whitlow


 
 

Re: Progress Status

"MacMan0295" <MacMan0295@xxxxxx> wrote in message
news:8CD2C53A-5CAD-4B2F-9BF0-4C5854088AF5@xxxxxx
Quote:

> All,
>
> Was wondering if there was a way to show the status of a script by doing
> something like the following:
>
> C:\Script in Progress...10%
>
> then when the script continues it will look like this
>
> C:\Script in Progress...20%
>
> I would like to do this so it doesnt take up the whole screen with a bunch
> of "..........". If I have 300000 loops, that is a lot of periods. I
> know
> how to figure out the percentage. Just need to know how to replace the
> text...
If you are doing this from a cscript window, you could use
'WScript.StdOut.Write' to write the percentage & when it changes, write
backspaces and then the new percentage. See code below for a simple example.
Make sure to run it from cscript. It will throw an exception if run from
wscript.

WScript.StdOut.Write "Script in Progress...00%"
For i = 1 to 10
WScript.Sleep 1000
WScript.StdOut.Write String(3, Chr(08)) & CStr(i * 10) & "%"
Next


My System SpecsSystem Spec
Old 08-12-2008   #5 (permalink)
Richard Mueller [MVP]


 
 

Re: Progress Status

Craig wrote:
Quote:

>
> Was wondering if there was a way to show the status of a script by doing
> something like the following:
>
> C:\Script in Progress...10%
>
> then when the script continues it will look like this
>
> C:\Script in Progress...20%
>
> I would like to do this so it doesnt take up the whole screen with a bunch
> of "..........". If I have 300000 loops, that is a lot of periods. I
> know
> how to figure out the percentage. Just need to know how to replace the
> text...
I have an exampe VBScript program that uses IE to display a dynamic message
indicating progress. The program is linked here:

http://www.rlmueller.net/IE%20Display.htm

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 08-12-2008   #6 (permalink)
MacMan0295


 
 

Re: Progress Status

This is exactly what I was looking for. Thank you for all the help.

Craig

"James Whitlow" wrote:
Quote:

> "MacMan0295" <MacMan0295@xxxxxx> wrote in message
> news:8CD2C53A-5CAD-4B2F-9BF0-4C5854088AF5@xxxxxx
Quote:

> > All,
> >
> > Was wondering if there was a way to show the status of a script by doing
> > something like the following:
> >
> > C:\Script in Progress...10%
> >
> > then when the script continues it will look like this
> >
> > C:\Script in Progress...20%
> >
> > I would like to do this so it doesnt take up the whole screen with a bunch
> > of "..........". If I have 300000 loops, that is a lot of periods. I
> > know
> > how to figure out the percentage. Just need to know how to replace the
> > text...
>
> If you are doing this from a cscript window, you could use
> 'WScript.StdOut.Write' to write the percentage & when it changes, write
> backspaces and then the new percentage. See code below for a simple example.
> Make sure to run it from cscript. It will throw an exception if run from
> wscript.
>
> WScript.StdOut.Write "Script in Progress...00%"
> For i = 1 to 10
> WScript.Sleep 1000
> WScript.StdOut.Write String(3, Chr(08)) & CStr(i * 10) & "%"
> Next
>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Pure Vb script progress or status bar VB Script
Sync Center suddenly lost Progress Bar and Sync status Vista General
Defrag status/progress information Vista General
Reading the Powershell progress bar (activity + progress) with C# PowerShell
zero progress Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46