Display VBS variable in command prompt

January 22, 2013 at 22:30:47
Specs: Windows 7

I would like to know how to display variable values in command prompt. Following is the vbs code:

For i=0 To 10
// I should display this variable value in command prompt
Next

If I write Shell.run(a.bat) inside loop, this will open command prompt 10 times.
But i want all 10 values to be displayed in single command prompt.


See More: Display VBS variable in command prompt

Report •


#1
January 22, 2013 at 22:43:44

Rather than trying to use a batch, you might want to use vbscript, if you just want to show a value:
'1)
for i=0 to 10
wscript.echo i
next
'2)
for i=0 to 10
wscript.stdout.writeline i
next
'======
shell.run is massive overkill for what you want. No need to spawn another kernel process just to display a number.
(ps: use cscript, not wscript, to run the script)

Report •
Related Solutions


Ask Question