• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Progress Status

M

MacMan0295

#1
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 Computer

M

mayayana

#2

>
> 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...
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 Computer

M

MacMan0295

#3
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:

>

> >
> > 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...
>
> 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 Computer

J

James Whitlow

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

> 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 Computer

R

Richard Mueller [MVP]

#5
Craig wrote:

>
> 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 Display.htm

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

My Computer

M

MacMan0295

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

Craig

"James Whitlow" wrote:

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

> > 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 Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)