Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display VBS variable in command prompt

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.

like image 700
Tjs Avatar asked Oct 22 '25 14:10

Tjs


1 Answers

Use WScript.Echo:

For i = 0 To 10
  WScript.Echo i
Next

You'll want to use CSCRIPT, either explicitly:

cscript vecho.vbs

Or make CSCRIPT the default:

cscript //H:CScript
like image 181
jimhark Avatar answered Oct 25 '25 23:10

jimhark